Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/gabriel-vasile/mimetype
/ types & classes
Types & classes
23 in github.com/gabriel-vasile/mimetype
⨍
Functions
472
◇
Types & classes
23
↓ 37 callers
TypeAlias
Bytes
Bytes is a byte slice with helper methods for easier scanning.
internal/scan/bytes.go:10
↓ 2 callers
TypeAlias
Flags
internal/scan/bytes.go:152
TypeAlias
CDFType
internal/cdf/cdf.go:15
FuncType
Detector
Detector receiveѕ the raw data of a file and returns whether the data meets any conditions. The limit parameter is an upper limit to the number of byt
internal/magic/magic.go:15
Struct
MIME
MIME struct holds information about a file format: the string representation of the MIME type, the extension and the parent file format.
mime.go:14
Struct
Parser
Parser is a CSV reader that only counts fields. It avoids allocating/copying memory and to verify behaviour, it is tested and fuzzed against encoding/
internal/csv/parser.go:12
Struct
cdf
cdf holds everything we need from a CDF file to do detection.
internal/cdf/cdf.go:41
Struct
dirEntry
dirEntry is a single CDF directory record. The UTF-16LE name is pre-decoded into an inline ASCII buffer at parse time, avoiding a per-entry heap alloc
internal/cdf/cdf.go:163
Struct
entrySpec
internal/cdf/cdf_test.go:111
TypeAlias
header
internal/mp3/frame.go:58
Struct
int32s
int32s works like a slice of LE int32 and is backed by a slice of bytes. int32s could very well be type int32s []byte, but that would mean len functio
internal/cdf/cdf.go:212
Struct
line
internal/csv/parser_test.go:15
Struct
parserState
parserState holds the state of JSON parsing. The number of inspected bytes, the current path inside the JSON object, etc.
internal/json/parser.go:58
Struct
pattern
pattern is a case-insensitive substring → CDFType mapping. Entries are tested in order; first match wins. needle is stored upper-cased so it can be ma
internal/cdf/cdf.go:582
Struct
query
query holds information about a combination of {"key": "val"} that we're trying to search for inside the JSON.
internal/json/parser.go:79
Struct
rfc822Hint
internal/magic/text.go:571
Struct
section
section is a (directory entry name, type) → CDFType mapping.
internal/cdf/cdf.go:634
Struct
shebangSig
internal/magic/magic.go:139
TypeAlias
ss
mimetype_test.go:493
Struct
testcase
testcases are used for correctness and benchmarks. testcase data is provided as a string for convenience, but that makes benchmarks allocate more. It
mimetype_test.go:21
Struct
xmlSig
internal/magic/magic.go:16
TypeAlias
zipEntries
internal/magic/zip.go:127
Struct
zipIterator
zipIterator iterates over a zip file returning the name of the zip entries in that file.
internal/magic/zip.go:123