• Stars
    star
    216
  • Rank 183,151 (Top 4 %)
  • Language
    Go
  • Created about 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go bindings for libmagic to detect MIME types

magicmime Build Status GoDoc

magicmime is a Go package which allows you to discover a file's mimetype by looking for magic numbers in its content. It could be used as a supplementary for Go's mime package which only interprets the file extension to detect mimetypes. Internally, it implements libmagic(3) bindings.

Tested on Linux and Mac OS X, should be working on BSD. You could be able to build and make it working with Cygwin on Windows.

Prerequisites

This uses the libmagic library from the file tool, so you might need to install the development package for libmagic. On Debian or Ubuntu: apt-get install libmagic-dev. On RHEL, CentOS or Fedora: yum install file-devel. On Mac OS X: brew install libmagic. If you don't have the required package, compilation will be terminated by an error saying magic.h cannot be found.

Usage

In order to start, go get this repository:

go get github.com/rakyll/magicmime

Examples

See godoc examples.

Docs

https://godoc.org/github.com/rakyll/magicmime

License

Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
     http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

hey

HTTP load generator, ApacheBench (ab) replacement
Go
17,864
star
2

boom

HTTP(S) load generator, ApacheBench (ab) replacement, written in Go
Go
4,745
star
3

statik

Embed files into a Go executable
Go
3,649
star
4

go-hardware

A directory of hardware related libs, tools, and tutorials for Go
Go
1,329
star
5

gom

A visual interface to work with runtime profiling data for Go
Go
1,295
star
6

gotest

go test with colors
Go
1,242
star
7

coop

Cheat sheet for some of the common concurrent flows in Go
Go
1,214
star
8

autopprof

Pprof made easy at development time for Go
Go
738
star
9

drive

Pull or push Google Drive files
Go
465
star
10

openai-go

Go client libraries for OpenAI
Go
443
star
11

go-test-trace

Go test with tracing.
Go
381
star
12

govalidate

Validates your Go installation and dependencies.
Go
335
star
13

portmidi

Go bindings for libportmidi
Go
283
star
14

globalconf

Persist flag values into an ini file
Go
275
star
15

ticktock

A cron job scheduler for Go
Go
209
star
16

go2xcode

Go package to Xcode project generator
Go
177
star
17

fake-it-til-you-make-it

A program that demonstrates that GitHub contribution graph can be cheated
Go
147
star
18

golambda

AWS Lambda Go functions made easy...
Go
137
star
19

launchpad

Talk to your Novation Launchpad in Go
Go
130
star
20

pprof-merge

Merge multiple pprof profile files into a single file
Go
118
star
21

events2prom

A metric collection daemon allows you to configure aggregations in runtime
Go
107
star
22

goproxy-s3

Go proxy that serves from S3
Go
104
star
23

go-sql-driver-spanner

Google Cloud Spanner driver for Go
Go
89
star
24

awesome-spanner

A curated list of awesome Google Cloud Spanner references, tools, libraries and more.
82
star
25

coinsensus

Decentralized distributed systems consensus
62
star
26

opencensus-grpc-demo

Export metrics and traces from gRPC servers and clients
Java
59
star
27

spannerz

Google Cloud Spanner Query Planner Visualizer
Go
59
star
28

aws-containers

My personal mind map of container platforms and tools on AWS
53
star
29

gowiki

Personal fork of Go wiki
47
star
30

command

CLI subcommands for Go
Go
44
star
31

trace

Drafts of a Dapper-style tracing client for Go
Go
44
star
32

obs-luts

LUT files to use with OBS
43
star
33

littlebits

littleBits Go module -- an io.Reader and io.Writer to read from and write to a circuit
Go
40
star
34

dfanout

A simple HTTP/2 fanout server
Go
38
star
35

goutil

Various Go utility packages.
Go
37
star
36

gce-metadata

GCE metadata command line tool
Go
32
star
37

myko

A simple attribution engine.
Go
28
star
38

log-to-xray

Write log entries, get X-Ray traces.
Go
27
star
39

pprof-upload

Upload pprof output to continuous profiler
Go
26
star
40

keys

Let your golang programs store and access passwords in a secure way
Go
26
star
41

go-numa

NUMA bindings for Go, requires libnuma.
Go
24
star
42

httpaa

Where http.HaandleFunc and alike lives.
Go
23
star
43

drummachine

Akai MPD18 replica written in Go, runs on mobile devices
Go
21
star
44

go-xcode

Reference Xcode project to build iOS apps with Go
Makefile
18
star
45

firmata

Firmata client for Go
Arduino
18
star
46

k8s-helloworld-leaderelection

Go
16
star
47

audio

Go
15
star
48

bubblr

Android client for App Engine Channels API
Java
15
star
49

rrqueue

Simple priority queues and round robin consumer for golang
Go
15
star
50

cosmicbackgroundmusic

Go
13
star
51

mysql-args-anonymizer

Go
13
star
52

sensors

Experiments with Android NDK sensors and Go
Go
13
star
53

redfail

Simple command to colorize the stderr of a target program
Go
12
star
54

opentelemetry-metric-go

Experiments, no real code.
Go
12
star
55

node-plussignin

Google+ Sign In middleware for Connect.
JavaScript
12
star
56

gcp-connectivitytests

Google Cloud Connectivity Tests
Go
11
star
57

perf2cloudprofiler

Upload perf output to Google Cloud profiler from anywhere
Go
10
star
58

drivefuse

Google Drive for Linux, BSD and MacOSX
C
10
star
59

grpcutil

Go
9
star
60

spanner-dotfiles

A set of personal aliases to use with Google Cloud Spanner.
7
star
61

talks

7
star
62

go-brillo

Go development notes for the Brillo targets. (External contributors who are willing to contribute are welcomed to comment.)
7
star
63

go-benchmarks

6
star
64

al

OpenAL bindings for Go (work-in-progress)
6
star
65

janis

The missing components of Android SDK
Java
6
star
66

pizza

rakyll.pizza
Go
6
star
67

rakyll.github.io

HTML
5
star
68

blinker

A tiny Raspberry Pi program controlled by a Go mobile app
Go
5
star
69

pubsub

Go
5
star
70

rakyll

Public profile...
5
star
71

refutil

Personal collection of reflection utils for Go
Go
4
star
72

benchmarks

Interesting Go benchmarks to watch
Go
4
star
73

experimental

Experimental Go packages
Go
3
star
74

node-ini

Simple ini reader for Node.js
JavaScript
3
star
75

snippetr

Extract code snippets from source code.
JavaScript
3
star
76

go0

$ docker run -i -t rakyll/go0
Dockerfile
2
star
77

ecs-metadata-proxy

Proxy to debug metadata server in ECS tasks
Go
2
star
78

aestaticdeploy

Takes a static directory and serves it on Google App Engine
Go
2
star
79

zigot

En extensible protocol for cloud storage, against of proprietary APIs.
2
star
80

appdatapreferences-localstorage

Syncs your local storage to Google Drive's appdata folder.
JavaScript
2
star
81

skeleton

skeletons for go projects
Go
1
star
82

travis-build

Go
1
star
83

colab-gemini

Jupyter Notebook
1
star
84

trace2

Go
1
star
85

allgo

All Go is a repo to be used to test godoc command and godoc.org
Go
1
star
86

dockerfiles

All images are ARMv7
1
star
87

reviews

Catch all repo for reviewing things.
1
star