matchers

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package matchers holds the matching functions used to find MIME types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AMp4

func AMp4(in []byte, _ uint32) bool

AMp4 matches an audio MP4 file.

func Aac added in v0.3.15

func Aac(in []byte, _ uint32) bool

Aac matches an Advanced Audio Coding file.

func Aaf added in v1.2.0

func Aaf(in []byte, _ uint32) bool

Aaf matches an Advanced Authoring Format file. See: https://pyaaf.readthedocs.io/en/latest/about.html See: https://en.wikipedia.org/wiki/Advanced_Authoring_Format

func Aiff

func Aiff(in []byte, _ uint32) bool

Aiff matches Audio Interchange File Format file.

func Amf added in v0.3.14

func Amf(in []byte, _ uint32) bool

Amf matches an Additive Manufacturing XML file.

func Amr

func Amr(in []byte, _ uint32) bool

Amr matches an Adaptive Multi-Rate file.

func Ape

func Ape(in []byte, _ uint32) bool

Ape matches a Monkey's Audio file.

func Ar added in v0.3.6

func Ar(in []byte, _ uint32) bool

Ar matches an ar (Unix) archive file.

func Asf added in v0.3.5

func Asf(in []byte, _ uint32) bool

Asf matches an Advanced Systems Format file.

func Atom added in v0.3.14

func Atom(in []byte, _ uint32) bool

Atom matches an Atom Syndication Format file.

func Au

func Au(in []byte, _ uint32) bool

Au matches a Sun Microsystems au file.

func Avi

func Avi(in []byte, _ uint32) bool

Avi matches an Audio Video Interleaved file.

func Bmp

func Bmp(in []byte, _ uint32) bool

Bmp matches a bitmap image file.

func Bpg added in v0.3.10

func Bpg(in []byte, _ uint32) bool

Bpg matches a Better Portable Graphics file.

func Bz2 added in v0.3.5

func Bz2(in []byte, _ uint32) bool

Bz2 matches a bzip2 file.

func Cab added in v1.0.1

func Cab(in []byte, _ uint32) bool

Cab matches a Cabinet archive file.

func Class

func Class(in []byte, _ uint32) bool

Class matches a java class file.

func Collada

func Collada(in []byte, _ uint32) bool

Collada matches a COLLAborative Design Activity file.

func Cpio added in v1.1.2

func Cpio(in []byte, _ uint32) bool

Cpio matches a cpio archive file

func Crx

func Crx(in []byte, _ uint32) bool

Crx matches a Chrome extension file: a zip archive prepended by "Cr24".

func Csv added in v0.3.4

func Csv(in []byte, _ uint32) bool

Csv matches a comma-separated values file.

func Dbf added in v0.3.3

func Dbf(in []byte, _ uint32) bool

Dbf matches a dBase file. https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm

func Dcm added in v0.3.7

func Dcm(in []byte, _ uint32) bool

Dcm matches a DICOM medical format file.

func Deb added in v0.3.8

func Deb(in []byte, _ uint32) bool

Deb matches a Debian package file.

func DjVu added in v0.3.9

func DjVu(in []byte, _ uint32) bool

DjVu matches a DjVu file.

func Doc

func Doc(in []byte, _ uint32) bool

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 Docx

func Docx(in []byte, _ uint32) bool

Docx matches a Microsoft Word 2007 file.

func Dwg added in v0.3.10

func Dwg(in []byte, _ uint32) bool

Dwg matches a CAD drawing file.

func Elf added in v0.3.6

func Elf(in []byte, _ uint32) bool

Elf matches an Executable and Linkable Format file.

func ElfDump added in v0.3.6

func ElfDump(in []byte, _ uint32) bool

ElfDump matches a core dump file.

func ElfExe added in v0.3.6

func ElfExe(in []byte, _ uint32) bool

ElfExe matches an executable file.

func ElfLib added in v0.3.6

func ElfLib(in []byte, _ uint32) bool

ElfLib matches a shared library file.

func ElfObj added in v0.3.6

func ElfObj(in []byte, _ uint32) bool

ElfObj matches an object file.

func Eot added in v0.3.16

func Eot(in []byte, _ uint32) bool

Eot matches an Embedded OpenType font file.

func Epub

func Epub(in []byte, _ uint32) bool

Epub matches an EPUB file.

func Exe added in v0.3.5

func Exe(in []byte, _ uint32) bool

Exe matches a Windows/DOS executable file.

func Fdf added in v1.1.2

func Fdf(in []byte, _ uint32) bool

Fdf matches a Forms Data Format file.

func Fits added in v0.3.5

func Fits(in []byte, _ uint32) bool

Fits matches an Flexible Image Transport System file.

func Flac

func Flac(in []byte, _ uint32) bool

Flac matches a Free Lossless Audio Codec file.

func Flv

func Flv(in []byte, _ uint32) bool

Flv matches a Flash video file.

func Gbr added in v1.1.2

func Gbr(in []byte, _ uint32) bool

Gbr matches GIMP brush data.

func GeoJson added in v0.3.2

func GeoJson(in []byte, _ uint32) bool

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 Gif

func Gif(in []byte, _ uint32) bool

Gif matches a Graphics Interchange Format file.

func Glb added in v1.2.0

func Glb(in []byte, _ uint32) bool

Glb matches a glTF model format file.

func Gml

func Gml(in []byte, _ uint32) bool

Gml matches a Geography Markup Language file.

func Gpx

func Gpx(in []byte, _ uint32) bool

Gpx matches a GPS Exchange Format file.

func Gzip

func Gzip(in []byte, _ uint32) bool

Gzip matched gzip files based on http://www.zlib.org/rfc-gzip.html#header-trailer.

func Hdr added in v1.2.0

func Hdr(in []byte, _ uint32) bool

Hdr matches Radiance HDR image. https://web.archive.org/web/20060913152809/http://local.wasp.uwa.edu.au/~pbourke/dataformats/pic/

func Heic added in v0.3.21

func Heic(in []byte, _ uint32) bool

Heic matches a High Efficiency Image Coding (HEIC) file.

func HeicSequence added in v0.3.21

func HeicSequence(in []byte, _ uint32) bool

HeicSequence matches a High Efficiency Image Coding (HEIC) file sequence.

func Heif added in v0.3.21

func Heif(in []byte, _ uint32) bool

Heif matches a High Efficiency Image File Format (HEIF) file.

func HeifSequence added in v0.3.21

func HeifSequence(in []byte, _ uint32) bool

HeifSequence matches a High Efficiency Image File Format (HEIF) file sequence.

func Html

func Html(in []byte, _ uint32) bool

Html matches a Hypertext Markup Language file.

func ICalendar added in v0.3.19

func ICalendar(in []byte, _ uint32) bool

ICalendar matches a iCalendar file.

func Icns added in v0.3.21

func Icns(in []byte, _ uint32) bool

Icns matches an ICNS (Apple Icon Image format) file.

func Ico

func Ico(in []byte, _ uint32) bool

Ico matches an ICO file.

func Jar

func Jar(in []byte, _ uint32) bool

Jar matches a Java archive file.

func Jp2 added in v0.3.20

func Jp2(in []byte, _ uint32) bool

Jp2 matches a JPEG 2000 Image file (ISO 15444-1).

func Jpg

func Jpg(in []byte, _ uint32) bool

Jpg matches a Joint Photographic Experts Group file.

func Jpm added in v0.3.20

func Jpm(in []byte, _ uint32) bool

Jpm matches a JPEG 2000 Image file (ISO 15444-6).

func Jpx added in v0.3.20

func Jpx(in []byte, _ uint32) bool

Jpx matches a JPEG 2000 Image file (ISO 15444-2).

func Js

func Js(in []byte, _ uint32) bool

Js matches a Javascript file.

func Json

func Json(in []byte, readLimit uint32) bool

Json matches a JavaScript Object Notation file.

func Kml

func Kml(in []byte, _ uint32) bool

Kml matches a Keyhole Markup Language file.

func Lit added in v0.3.9

func Lit(in []byte, _ uint32) bool

Lit matches a Microsoft Lit file.

func Lua

func Lua(in []byte, _ uint32) bool

Lua matches a Lua programming language file.

func Lzip added in v1.0.5

func Lzip(in []byte, _ uint32) bool

Lzip matches an Lzip compressed file.

func M3u added in v1.1.2

func M3u(in []byte, _ uint32) bool

M3u matches a Playlist file.

func M4a

func M4a(in []byte, _ uint32) bool

M4a matches an audio M4A file.

func M4v added in v1.0.3

func M4v(in []byte, _ uint32) bool

M4v matches an Appl4 M4V video file.

func MachO added in v0.3.21

func MachO(in []byte, _ uint32) bool

MachO matches Mach-O binaries format.

func Marc added in v0.3.21

func Marc(in []byte, _ uint32) bool

Marc matches a MARC21 (MAchine-Readable Cataloging) file.

func Midi

func Midi(in []byte, _ uint32) bool

Midi matches a Musical Instrument Digital Interface file.

func Mkv

func Mkv(in []byte, _ uint32) bool

Mkv matches a mkv file.

func Mobi added in v0.3.9

func Mobi(in []byte, _ uint32) bool

Mobi matches a Mobi file.

func Mp3

func Mp3(in []byte, _ uint32) bool

Mp3 matches an mp3 file.

func Mp4

func Mp4(in []byte, _ uint32) bool

Mp4 matches an MP4 file.

func Mpeg

func Mpeg(in []byte, _ uint32) bool

Mpeg matches a Moving Picture Experts Group file.

func Mqv

func Mqv(in []byte, _ uint32) bool

Mqv matches a Sony / Mobile QuickTime file.

func MsAccessAce added in v0.3.22

func MsAccessAce(in []byte, _ uint32) bool

MsAccessAce matches Microsoft Access dababase file.

func MsAccessMdb added in v0.3.22

func MsAccessMdb(in []byte, _ uint32) bool

MsAccessMdb matches legacy Microsoft Access database file (JET, 2003 and earlier).

func Msg added in v1.1.2

func Msg(in []byte, _ uint32) bool

Msg matches a Microsoft Outlook email file.

func MusePack

func MusePack(in []byte, _ uint32) bool

MusePack matches a Musepack file.

func NdJson added in v0.3.18

func NdJson(in []byte, readLimit uint32) bool

NdJson matches a Newline delimited JSON file.

func Nes added in v0.3.21

func Nes(in []byte, _ uint32) bool

Nes matches a Nintendo Entertainment system ROM file.

func Odc added in v1.2.0

func Odc(in []byte, _ uint32) bool

Odc matches an OpenDocument Chart file.

func Odf added in v0.3.7

func Odf(in []byte, _ uint32) bool

Odf matches an OpenDocument Formula file.

func Odg added in v0.3.7

func Odg(in []byte, _ uint32) bool

Odg matches an OpenDocument Drawing file.

func Odp added in v0.3.7

func Odp(in []byte, _ uint32) bool

Odp matches an OpenDocument Presentation file.

func Ods added in v0.3.7

func Ods(in []byte, _ uint32) bool

Ods matches an OpenDocument Spreadsheet file.

func Odt added in v0.3.7

func Odt(in []byte, _ uint32) bool

Odt matches an OpenDocument Text file.

func Ogg

func Ogg(in []byte, _ uint32) bool

Ogg matches an Ogg file.

func OggAudio added in v0.3.19

func OggAudio(in []byte, _ uint32) bool

OggAudio matches an audio ogg file.

func OggVideo added in v0.3.19

func OggVideo(in []byte, _ uint32) bool

OggVideo matches a video ogg file.

func Ole added in v0.3.21

func Ole(in []byte, _ uint32) bool

Ole matches an Open Linking and Embedding file.

https://en.wikipedia.org/wiki/Object_Linking_and_Embedding

func Otf added in v0.3.16

func Otf(in []byte, _ uint32) bool

Otf matches an OpenType font file.

func Otg added in v0.3.7

func Otg(in []byte, _ uint32) bool

Otg matches an OpenDocument Drawing Template file.

func Otp added in v0.3.7

func Otp(in []byte, _ uint32) bool

Otp matches an OpenDocument Presentation Template file.

func Ots added in v0.3.7

func Ots(in []byte, _ uint32) bool

Ots matches an OpenDocument Spreadsheet Template file.

func Ott added in v0.3.7

func Ott(in []byte, _ uint32) bool

Ott matches an OpenDocument Text Template file.

func Owl2 added in v1.2.0

func Owl2(in []byte, _ uint32) bool

Owl2 matches an Owl ontology file.

func P7s added in v1.1.2

func P7s(in []byte, _ uint32) bool

P7s matches an .p7s signature File (PEM, Base64).

func Pat added in v1.1.2

func Pat(in []byte, _ uint32) bool

Pat matches GIMP pattern data.

func Pdf

func Pdf(in []byte, _ uint32) bool

Pdf matches a Portable Document Format file.

func Perl

func Perl(in []byte, _ uint32) bool

Perl matches a Perl programming language file.

func Php

func Php(in []byte, _ uint32) bool

Php matches a PHP: Hypertext Preprocessor file.

func Png

func Png(in []byte, _ uint32) bool

Png matches a Portable Network Graphics file.

func Ppt

func Ppt(in []byte, _ uint32) bool

Ppt matches a Microsoft PowerPoint 97-2003 file or a PowerPoint 95 presentation.

func Pptx

func Pptx(in []byte, _ uint32) bool

Pptx matches a Microsoft PowerPoint 2007 file.

func Ps

func Ps(in []byte, _ uint32) bool

Ps matches a PostScript file.

func Psd

func Psd(in []byte, _ uint32) bool

Psd matches a Photoshop Document file.

func Pub added in v0.3.22

func Pub(in []byte, _ uint32) bool

Pub matches a Microsoft Publisher file.

func Python

func Python(in []byte, _ uint32) bool

Python matches a Python programming language file.

func Qcp added in v0.3.21

func Qcp(in []byte, _ uint32) bool

Qcp matches a Qualcomm Pure Voice file.

func QuickTime

func QuickTime(in []byte, _ uint32) bool

QuickTime matches a QuickTime File Format file.

func Rar added in v0.3.9

func Rar(in []byte, _ uint32) bool

Rar matches a RAR archive file.

func Rmvb added in v1.1.1

func Rmvb(in []byte, _ uint32) bool

Rmvb matches a RealMedia Variable Bitrate file.

func Rpm added in v1.0.3

func Rpm(in []byte, _ uint32) bool

Rpm matches an RPM or Delta RPM package file.

func Rss added in v0.3.14

func Rss(in []byte, _ uint32) bool

Rss matches a Rich Site Summary file.

func Rtf

func Rtf(in []byte, _ uint32) bool

Rtf matches a Rich Text Format file.

func SevenZ

func SevenZ(in []byte, _ uint32) bool

SevenZ matches a 7z archive.

func Shp added in v0.3.3

func Shp(in []byte, _ uint32) bool

Shp matches a shape format file. https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

func Shx added in v0.3.3

func Shx(in []byte, _ uint32) bool

Shx matches a shape index format file. https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

func Sqlite added in v0.3.10

func Sqlite(in []byte, _ uint32) bool

Sqlite matches an SQLite database file.

func Svg

func Svg(in []byte, _ uint32) bool

Svg matches a SVG file.

func Swf

func Swf(in []byte, _ uint32) bool

Swf matches an Adobe Flash swf file.

func Sxc added in v1.2.0

func Sxc(in []byte, _ uint32) bool

Sxc matches an OpenOffice Spreadsheet file.

func Tar

func Tar(in []byte, _ uint32) bool

Tar matches a (t)ape (ar)chive file.

func Tcl

func Tcl(in []byte, _ uint32) bool

Tcl matches a Tcl programming language file.

func Tcx

func Tcx(in []byte, _ uint32) bool

Tcx matches a Training Center XML file.

func ThreeG2

func ThreeG2(in []byte, _ uint32) bool

ThreeG2 matches a 3GPP2 file.

func ThreeGP

func ThreeGP(in []byte, _ uint32) bool

ThreeGP matches a 3GPP file.

func Threemf added in v0.3.14

func Threemf(in []byte, _ uint32) bool

Threemf matches a 3D Manufacturing Format file.

func Tiff

func Tiff(in []byte, _ uint32) bool

Tiff matches a Tagged Image File Format file.

func Torrent added in v1.1.1

func Torrent(in []byte, _ uint32) bool

Torrent has bencoded text in the beginning

func Tsv added in v0.3.4

func Tsv(in []byte, _ uint32) bool

Tsv matches a tab-separated values file.

func Ttf added in v1.0.4

func Ttf(in []byte, _ uint32) bool

Ttf matches a TrueType font file.

func TzIf added in v1.1.2

func TzIf(in []byte, _ uint32) bool

TzIf matches a Time Zone Information Format (TZif) file.

func Utf16be added in v1.0.1

func Utf16be(in []byte, _ uint32) bool

Utf16be matches a text file encoded with UTF-16 and with the characters represented in big endian.

func Utf16le added in v1.0.1

func Utf16le(in []byte, _ uint32) bool

Utf16le matches a text file encoded with UTF-16 and with the characters represented in little endian.

func Utf32be added in v1.0.2

func Utf32be(in []byte, _ uint32) bool

Utf32be matches a text file encoded with UTF-32 and with the characters represented in big endian.

func Utf32le added in v1.0.2

func Utf32le(in []byte, _ uint32) bool

Utf32le matches a text file encoded with UTF-32 and with the characters represented in little endian.

func Utf8 added in v1.0.1

func Utf8(in []byte, _ uint32) bool

Utf8 matches an UTF-8 text file.

func VCard added in v0.3.8

func VCard(in []byte, _ uint32) bool

VCard matches a Virtual Contact File.

func Voc added in v0.3.15

func Voc(in []byte, _ uint32) bool

Voc matches a Creative Voice file.

func Warc added in v0.3.19

func Warc(in []byte, _ uint32) bool

Warc matches a Web ARChive file.

func Wasm

func Wasm(in []byte, _ uint32) bool

Wasm matches a web assembly File Format file.

func Wav

func Wav(in []byte, _ uint32) bool

Wav matches a Waveform Audio File Format file.

func WebM

func WebM(in []byte, _ uint32) bool

WebM matches a WebM file.

func Webp

func Webp(in []byte, _ uint32) bool

Webp matches a WebP file.

func Woff

func Woff(in []byte, _ uint32) bool

Woff matches a Web Open Font Format file.

func Woff2

func Woff2(in []byte, _ uint32) bool

Woff2 matches a Web Open Font Format version 2 file.

func X3d

func X3d(in []byte, _ uint32) bool

X3d matches an Extensible 3D Graphics file.

func Xar added in v0.3.5

func Xar(in []byte, _ uint32) bool

Xar matches an eXtensible ARchive format file.

func Xcf added in v1.1.2

func Xcf(in []byte, _ uint32) bool

Xcf matches GIMP image data.

func Xfdf added in v1.1.2

func Xfdf(in []byte, _ uint32) bool

Xfdf matches a XML Forms Data Format file.

func Xliff added in v0.3.13

func Xliff(in []byte, _ uint32) bool

Xliff matches a XML Localization Interchange File Format file.

func Xls

func Xls(in []byte, _ uint32) bool

Xls matches a Microsoft Excel 97-2003 file.

func Xlsx

func Xlsx(in []byte, _ uint32) bool

Xlsx matches a Microsoft Excel 2007 file.

func Xml

func Xml(in []byte, _ uint32) bool

Xml matches an Extensible Markup Language file.

func Xz added in v1.0.4

func Xz(in []byte, _ uint32) bool

Xz matches an xz compressed stream based on https://tukaani.org/xz/xz-file-format.txt.

func Zip

func Zip(in []byte, _ uint32) bool

Zip matches a zip archive.

func Zstd added in v0.3.23

func Zstd(in []byte, _ uint32) bool

Zstd matches a Zstandard archive file.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL