magicmime

Go bindings for libmagic to detect MIME types

  • 所有者: rakyll/magicmime
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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.

主要指標

概覽
名稱與所有者rakyll/magicmime
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證
所有者活动
創建於2013-10-02 12:40:09
推送於2024-03-29 16:58:10
最后一次提交2018-01-11 19:44:28
發布數1
最新版本名稱v0.1.0 (發布於 2017-12-15 12:55:57)
第一版名稱v0.1.0 (發布於 2017-12-15 12:55:57)
用户参与
星數227
關注者數10
派生數64
提交數54
已啟用問題?
問題數21
打開的問題數8
拉請求數10
打開的拉請求數7
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?