Documentation ¶
Overview ¶
Package matchers holds the matching functions used to find MIME types.
Index ¶
- Constants
- func AMp4(in []byte) bool
- func Aac(in []byte) bool
- func Aiff(in []byte) bool
- func Amf(in []byte) bool
- func Amr(in []byte) bool
- func Ape(in []byte) bool
- func Ar(in []byte) bool
- func Asf(in []byte) bool
- func Atom(in []byte) bool
- func Au(in []byte) bool
- func Avi(in []byte) bool
- func Bmp(in []byte) bool
- func Bpg(in []byte) bool
- func Bz2(in []byte) bool
- func Cab(in []byte) bool
- func Class(in []byte) bool
- func Collada(in []byte) bool
- func Cpio(in []byte) bool
- func Crx(in []byte) bool
- func Css(in []byte) bool
- func Csv(in []byte) bool
- func Dbf(in []byte) bool
- func Dcm(in []byte) bool
- func Deb(in []byte) bool
- func DjVu(in []byte) bool
- func Doc(in []byte) bool
- func Docx(in []byte) bool
- func Dwg(in []byte) bool
- func Elf(in []byte) bool
- func ElfDump(in []byte) bool
- func ElfExe(in []byte) bool
- func ElfLib(in []byte) bool
- func ElfObj(in []byte) bool
- func Eot(in []byte) bool
- func Epub(in []byte) bool
- func Exe(in []byte) bool
- func Fits(in []byte) bool
- func Flac(in []byte) bool
- func Flv(in []byte) bool
- func GeoJson(in []byte) bool
- func Gif(in []byte) bool
- func Gml(in []byte) bool
- func Gpx(in []byte) bool
- func Gzip(in []byte) bool
- func Heic(in []byte) bool
- func HeicSequence(in []byte) bool
- func Heif(in []byte) bool
- func HeifSequence(in []byte) bool
- func Html(in []byte) bool
- func ICalendar(in []byte) bool
- func Icns(in []byte) bool
- func Ico(in []byte) bool
- func Jar(in []byte) bool
- func Jp2(in []byte) bool
- func Jpg(in []byte) bool
- func Jpm(in []byte) bool
- func Jpx(in []byte) bool
- func Js(in []byte) bool
- func Json(in []byte) bool
- func Kml(in []byte) bool
- func Lit(in []byte) bool
- func Lua(in []byte) bool
- func Lzip(in []byte) bool
- func M4a(in []byte) bool
- func M4v(in []byte) bool
- func MachO(in []byte) bool
- func Marc(in []byte) bool
- func Midi(in []byte) bool
- func Mkv(in []byte) bool
- func Mobi(in []byte) bool
- func Mp3(in []byte) bool
- func Mp4(in []byte) bool
- func Mpeg(in []byte) bool
- func Mqv(in []byte) bool
- func MsAccessAce(in []byte) bool
- func MsAccessMdb(in []byte) bool
- func Msg(in []byte) bool
- func MusePack(in []byte) bool
- func NdJson(in []byte) bool
- func Nes(in []byte) bool
- func Odf(in []byte) bool
- func Odg(in []byte) bool
- func Odp(in []byte) bool
- func Ods(in []byte) bool
- func Odt(in []byte) bool
- func Ogg(in []byte) bool
- func OggAudio(in []byte) bool
- func OggVideo(in []byte) bool
- func Ole(in []byte) bool
- func Otf(in []byte) bool
- func Otg(in []byte) bool
- func Otp(in []byte) bool
- func Ots(in []byte) bool
- func Ott(in []byte) bool
- func Pdf(in []byte) bool
- func Perl(in []byte) bool
- func Php(in []byte) bool
- func Png(in []byte) bool
- func Ppt(in []byte) bool
- func Pptx(in []byte) bool
- func Ps(in []byte) bool
- func Psd(in []byte) bool
- func Pub(in []byte) bool
- func Python(in []byte) bool
- func Qcp(in []byte) bool
- func QuickTime(in []byte) bool
- func Rar(in []byte) bool
- func Rmvb(in []byte) bool
- func Rpm(in []byte) bool
- func Rss(in []byte) bool
- func Rtf(in []byte) bool
- func SevenZ(in []byte) bool
- func Shp(in []byte) bool
- func Shx(in []byte) bool
- func Sqlite(in []byte) bool
- func Svg(in []byte) bool
- func Swf(in []byte) bool
- func Tar(in []byte) bool
- func Tcl(in []byte) bool
- func Tcx(in []byte) bool
- func ThreeG2(in []byte) bool
- func ThreeGP(in []byte) bool
- func Threemf(in []byte) bool
- func Tiff(in []byte) bool
- func Torrent(in []byte) bool
- func Tsv(in []byte) bool
- func Ttf(in []byte) bool
- func Utf16be(in []byte) bool
- func Utf16le(in []byte) bool
- func Utf32be(in []byte) bool
- func Utf32le(in []byte) bool
- func Utf8(in []byte) bool
- func VCard(in []byte) bool
- func Voc(in []byte) bool
- func Warc(in []byte) bool
- func Wasm(in []byte) bool
- func Wav(in []byte) bool
- func WebM(in []byte) bool
- func Webp(in []byte) bool
- func Woff(in []byte) bool
- func Woff2(in []byte) bool
- func X3d(in []byte) bool
- func Xar(in []byte) bool
- func Xliff(in []byte) bool
- func Xls(in []byte) bool
- func Xlsx(in []byte) bool
- func Xml(in []byte) bool
- func Xz(in []byte) bool
- func Zip(in []byte) bool
- func Zstd(in []byte) bool
- Bugs
Constants ¶
const ReadLimit = 3072
ReadLimit is the maximum number of bytes read from the input when detecting from a reader or from a file.
Variables ¶
This section is empty.
Functions ¶
func Dbf ¶
Dbf matches a dBase file. https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
func Doc ¶
Doc matches a Microsoft Word 97-2003 file.
BUG(gabriel-vasile): Doc should look for subheaders like Ppt and Xls does.
Ole is a container for Doc, Ppt, Pub and Xls. Right now, when an Ole file is detected, it is considered to be a Doc file if the checks for Ppt, Pub and Xls failed.
func GeoJson ¶
GeoJson matches a RFC 7946 GeoJSON file.
GeoJson detection implies searching for key:value pairs like: `"type": "Feature"` in the input. BUG(gabriel-vasile): The "type" key should be searched for in the root object.
func Gzip ¶
Gzip matched gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer.
func HeicSequence ¶
HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence.
func HeifSequence ¶
HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence.
func MsAccessAce ¶
MsAccessAce matches Microsoft Access dababase file.
func MsAccessMdb ¶
MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier).
func Shp ¶
Shp matches a shape format file. https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf
func Shx ¶
Shx matches a shape index format file. https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf
func Utf16be ¶
Utf16be matches a text file encoded with UTF-16 and with the characters represented in big endian.
func Utf16le ¶
Utf16le matches a text file encoded with UTF-16 and with the characters represented in little endian.
func Utf32be ¶
Utf32be matches a text file encoded with UTF-32 and with the characters represented in big endian.
func Utf32le ¶
Utf32le matches a text file encoded with UTF-32 and with the characters represented in little endian.
func Xz ¶
Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt.
Types ¶
This section is empty.
Notes ¶
Bugs ¶
Doc should look for subheaders like Ppt and Xls does.
Ole is a container for Doc, Ppt, Pub and Xls. Right now, when an Ole file is detected, it is considered to be a Doc file if the checks for Ppt, Pub and Xls failed.
The "type" key should be searched for in the root object.