matchers

package
v1.1.2-0...-a675e6a Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
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 AMp4

func AMp4(in []byte) bool

AMp4 matches an audio MP4 file.

func Aac

func Aac(in []byte) bool

Aac matches an Advanced Audio Coding file.

func Aiff

func Aiff(in []byte) bool

Aiff matches Audio Interchange File Format file.

func Amf

func Amf(in []byte) bool

Amf matches an Additive Manufacturing XML file.

func Amr

func Amr(in []byte) bool

Amr matches an Adaptive Multi-Rate file.

func Ape

func Ape(in []byte) bool

Ape matches a Monkey's Audio file.

func Ar

func Ar(in []byte) bool

Ar matches an ar (Unix) archive file.

func Asf

func Asf(in []byte) bool

Asf matches an Advanced Systems Format file.

func Atom

func Atom(in []byte) bool

Atom matches an Atom Syndication Format file.

func Au

func Au(in []byte) bool

Au matches a Sun Microsystems au file.

func Avi

func Avi(in []byte) bool

Avi matches an Audio Video Interleaved file.

func Bmp

func Bmp(in []byte) bool

Bmp matches a bitmap image file.

func Bpg

func Bpg(in []byte) bool

Bpg matches a Better Portable Graphics file.

func Bz2

func Bz2(in []byte) bool

Bz2 matches a bzip2 file.

func Cab

func Cab(in []byte) bool

Cab matches a Cabinet archive file.

func Class

func Class(in []byte) bool

Class matches a java class file.

func Collada

func Collada(in []byte) bool

Collada matches a COLLAborative Design Activity file.

func Cpio

func Cpio(in []byte) bool

Cpio matches a cpio archive file

func Crx

func Crx(in []byte) bool

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

func Css

func Css(in []byte) bool

Css matches a cascading style sheet

func Csv

func Csv(in []byte) bool

Csv matches a comma-separated values file.

func Dbf

func Dbf(in []byte) bool

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

func Dcm

func Dcm(in []byte) bool

Dcm matches a DICOM medical format file.

func Deb

func Deb(in []byte) bool

Deb matches a Debian package file.

func DjVu

func DjVu(in []byte) bool

DjVu matches a DjVu file.

func Doc

func Doc(in []byte) 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) bool

Docx matches a Microsoft Word 2007 file.

func Dwg

func Dwg(in []byte) bool

Dwg matches a CAD drawing file.

func Elf

func Elf(in []byte) bool

Elf matches an Executable and Linkable Format file.

func ElfDump

func ElfDump(in []byte) bool

ElfDump matches a core dump file.

func ElfExe

func ElfExe(in []byte) bool

ElfExe matches an executable file.

func ElfLib

func ElfLib(in []byte) bool

ElfLib matches a shared library file.

func ElfObj

func ElfObj(in []byte) bool

ElfObj matches an object file.

func Eot

func Eot(in []byte) bool

Eot matches an Embedded OpenType font file.

func Epub

func Epub(in []byte) bool

Epub matches an EPUB file.

func Exe

func Exe(in []byte) bool

Exe matches a Windows/DOS executable file.

func Fits

func Fits(in []byte) bool

Fits matches an Flexible Image Transport System file.

func Flac

func Flac(in []byte) bool

Flac matches a Free Lossless Audio Codec file.

func Flv

func Flv(in []byte) bool

Flv matches a Flash video file.

func GeoJson

func GeoJson(in []byte) 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) bool

Gif matches a Graphics Interchange Format file.

func Gml

func Gml(in []byte) bool

Gml matches a Geography Markup Language file.

func Gpx

func Gpx(in []byte) bool

Gpx matches a GPS Exchange Format file.

func Gzip

func Gzip(in []byte) bool

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

func Heic

func Heic(in []byte) bool

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

func HeicSequence

func HeicSequence(in []byte) bool

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

func Heif

func Heif(in []byte) bool

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

func HeifSequence

func HeifSequence(in []byte) bool

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

func Html

func Html(in []byte) bool

Html matches a Hypertext Markup Language file.

func ICalendar

func ICalendar(in []byte) bool

ICalendar matches a iCalendar file.

func Icns

func Icns(in []byte) bool

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

func Ico

func Ico(in []byte) bool

Ico matches an ICO file.

func Jar

func Jar(in []byte) bool

Jar matches a Java archive file.

func Jp2

func Jp2(in []byte) bool

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

func Jpg

func Jpg(in []byte) bool

Jpg matches a Joint Photographic Experts Group file.

func Jpm

func Jpm(in []byte) bool

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

func Jpx

func Jpx(in []byte) bool

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

func Js

func Js(in []byte) bool

Js matches a Javascript file.

func Json

func Json(in []byte) bool

Json matches a JavaScript Object Notation file.

func Kml

func Kml(in []byte) bool

Kml matches a Keyhole Markup Language file.

func Lit

func Lit(in []byte) bool

Lit matches a Microsoft Lit file.

func Lua

func Lua(in []byte) bool

Lua matches a Lua programming language file.

func Lzip

func Lzip(in []byte) bool

func M4a

func M4a(in []byte) bool

M4a matches an audio M4A file.

func M4v

func M4v(in []byte) bool

M4v matches an Appl4 M4V video file.

func MachO

func MachO(in []byte) bool

MachO matches Mach-O binaries format.

func Marc

func Marc(in []byte) bool

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

func Midi

func Midi(in []byte) bool

Midi matches a Musical Instrument Digital Interface file.

func Mkv

func Mkv(in []byte) bool

Mkv matches a mkv file.

func Mobi

func Mobi(in []byte) bool

Mobi matches a Mobi file.

func Mp3

func Mp3(in []byte) bool

Mp3 matches an mp3 file.

func Mp4

func Mp4(in []byte) bool

Mp4 matches an MP4 file.

func Mpeg

func Mpeg(in []byte) bool

Mpeg matches a Moving Picture Experts Group file.

func Mqv

func Mqv(in []byte) bool

Mqv matches a Sony / Mobile QuickTime file.

func MsAccessAce

func MsAccessAce(in []byte) bool

MsAccessAce matches Microsoft Access dababase file.

func MsAccessMdb

func MsAccessMdb(in []byte) bool

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

func Msg

func Msg(in []byte) bool

Msg matches a Microsoft Outlook email file.

func MusePack

func MusePack(in []byte) bool

MusePack matches a Musepack file.

func NdJson

func NdJson(in []byte) bool

NdJson matches a Newline delimited JSON file.

func Nes

func Nes(in []byte) bool

Nes matches a Nintendo Entertainment system ROM file.

func Odf

func Odf(in []byte) bool

Odf matches an OpenDocument Formula file.

func Odg

func Odg(in []byte) bool

Odg matches an OpenDocument Drawing file.

func Odp

func Odp(in []byte) bool

Odp matches an OpenDocument Presentation file.

func Ods

func Ods(in []byte) bool

Ods matches an OpenDocument Spreadsheet file.

func Odt

func Odt(in []byte) bool

Odt matches an OpenDocument Text file.

func Ogg

func Ogg(in []byte) bool

Ogg matches an Ogg file.

func OggAudio

func OggAudio(in []byte) bool

OggAudio matches an audio ogg file.

func OggVideo

func OggVideo(in []byte) bool

OggVideo matches a video ogg file.

func Ole

func Ole(in []byte) bool

Ole matches an Open Linking and Embedding file.

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

func Otf

func Otf(in []byte) bool

Otf matches an OpenType font file.

func Otg

func Otg(in []byte) bool

Otg matches an OpenDocument Drawing Template file.

func Otp

func Otp(in []byte) bool

Otp matches an OpenDocument Presentation Template file.

func Ots

func Ots(in []byte) bool

Ots matches an OpenDocument Spreadsheet Template file.

func Ott

func Ott(in []byte) bool

Ott matches an OpenDocument Text Template file.

func Pdf

func Pdf(in []byte) bool

Pdf matches a Portable Document Format file.

func Perl

func Perl(in []byte) bool

Perl matches a Perl programming language file.

func Php

func Php(in []byte) bool

Php matches a PHP: Hypertext Preprocessor file.

func Png

func Png(in []byte) bool

Png matches a Portable Network Graphics file.

func Ppt

func Ppt(in []byte) bool

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

func Pptx

func Pptx(in []byte) bool

Pptx matches a Microsoft PowerPoint 2007 file.

func Ps

func Ps(in []byte) bool

Ps matches a PostScript file.

func Psd

func Psd(in []byte) bool

Psd matches a Photoshop Document file.

func Pub

func Pub(in []byte) bool

Pub matches a Microsoft Publisher file.

func Python

func Python(in []byte) bool

Python matches a Python programming language file.

func Qcp

func Qcp(in []byte) bool

Qcp matches a Qualcomm Pure Voice file.

func QuickTime

func QuickTime(in []byte) bool

QuickTime matches a QuickTime File Format file.

func Rar

func Rar(in []byte) bool

Rar matches a RAR archive file.

func Rmvb

func Rmvb(in []byte) bool

Rmvb matches a RealMedia Variable Bitrate file.

func Rpm

func Rpm(in []byte) bool

Rpm matches an RPM or Delta RPM package file.

func Rss

func Rss(in []byte) bool

Rss matches a Rich Site Summary file.

func Rtf

func Rtf(in []byte) bool

Rtf matches a Rich Text Format file.

func SevenZ

func SevenZ(in []byte) bool

SevenZ matches a 7z archive.

func Shp

func Shp(in []byte) bool

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

func Shx

func Shx(in []byte) bool

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

func Sqlite

func Sqlite(in []byte) bool

Sqlite matches an SQLite database file.

func Svg

func Svg(in []byte) bool

Svg matches a SVG file.

func Swf

func Swf(in []byte) bool

Swf matches an Adobe Flash swf file.

func Tar

func Tar(in []byte) bool

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

func Tcl

func Tcl(in []byte) bool

Tcl matches a Tcl programming language file.

func Tcx

func Tcx(in []byte) bool

Tcx matches a Training Center XML file.

func ThreeG2

func ThreeG2(in []byte) bool

ThreeG2 matches a 3GPP2 file.

func ThreeGP

func ThreeGP(in []byte) bool

ThreeGP matches a 3GPP file.

func Threemf

func Threemf(in []byte) bool

Threemf matches a 3D Manufacturing Format file.

func Tiff

func Tiff(in []byte) bool

Tiff matches a Tagged Image File Format file.

func Torrent

func Torrent(in []byte) bool

Torrent has bencoded text in the beginning

func Tsv

func Tsv(in []byte) bool

Tsv matches a tab-separated values file.

func Ttf

func Ttf(in []byte) bool

Ttf matches a TrueType font file.

func Utf16be

func Utf16be(in []byte) bool

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

func Utf16le

func Utf16le(in []byte) bool

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

func Utf32be

func Utf32be(in []byte) bool

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

func Utf32le

func Utf32le(in []byte) bool

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

func Utf8

func Utf8(in []byte) bool

Utf8 matches an UTF-8 text file.

func VCard

func VCard(in []byte) bool

VCard matches a Virtual Contact File.

func Voc

func Voc(in []byte) bool

Voc matches a Creative Voice file.

func Warc

func Warc(in []byte) bool

Warc matches a Web ARChive file.

func Wasm

func Wasm(in []byte) bool

Wasm matches a web assembly File Format file.

func Wav

func Wav(in []byte) bool

Wav matches a Waveform Audio File Format file.

func WebM

func WebM(in []byte) bool

WebM matches a WebM file.

func Webp

func Webp(in []byte) bool

Webp matches a WebP file.

func Woff

func Woff(in []byte) bool

Woff matches a Web Open Font Format file.

func Woff2

func Woff2(in []byte) bool

Woff2 matches a Web Open Font Format version 2 file.

func X3d

func X3d(in []byte) bool

X3d matches an Extensible 3D Graphics file.

func Xar

func Xar(in []byte) bool

Xar matches an eXtensible ARchive format file.

func Xliff

func Xliff(in []byte) bool

Xliff matches a XML Localization Interchange File Format file.

func Xls

func Xls(in []byte) bool

Xls matches a Microsoft Excel 97-2003 file.

func Xlsx

func Xlsx(in []byte) bool

Xlsx matches a Microsoft Excel 2007 file.

func Xml

func Xml(in []byte) bool

Xml matches an Extensible Markup Language file.

func Xz

func Xz(in []byte) bool

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

func Zip

func Zip(in []byte) bool

Zip matches a zip archive.

func Zstd

func Zstd(in []byte) 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