Documentation ¶
Overview ¶
Package magic implements MIME type sniffing of data based on the well-known "magic" number prefixes in the file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MIMEType ¶
MIMEType returns the MIME type from the data in the provided header of the data. It returns the empty string if the MIME type can't be determined.
func MIMETypeFromReader ¶
MIMETypeFromReader takes a reader, sniffs the beginning of it, and returns the mime (if sniffed, else "") and a new reader that's the concatenation of the bytes sniffed and the remaining reader.
func MIMETypeFromReaderAt ¶
MIMETypeFromReader takes a ReaderAt, sniffs the beginning of it, and returns the MIME type if sniffed, else the empty string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.