Documentation ¶
Overview ¶
package mime implements part of the shared-mime-info spec for guessing by extension and partial matching by header
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database holds the LUTs for glob matching and magic matching
func (*Database) GuessExtByMIME ¶
GuessExtByMIME attempts to get a file extension (including the dot) by a mime type.
func (*Database) GuessMIMEByHeader ¶
GuessMIMEByHeader attemtps to deterimine the MIME type by the file's header. It returns "" on failure
func (*Database) GuessMIMEByName ¶
GuessMIMEByName guesses a mime type by filename. This is faster than guessing by magic, but very easy to fool returns a empty string on failure
func (*Database) ReadFreeDesktop ¶
ReadFreeDesktop reads into a existing database from a XML document stream describing mime matching
func (*Database) RecommendedLength ¶
RecommendedLength returns the length required by GuessMIMEByHeader for all matches
Directories ¶
Path | Synopsis |
---|---|
package freedesktop provides the verbatim FreeDesktop shared-mime-lib decoders.
|
package freedesktop provides the verbatim FreeDesktop shared-mime-lib decoders. |
package minimal provides a more minimal set of mime types tailored more to webservers where serving a video with the corrent MIME is more important than a word document
|
package minimal provides a more minimal set of mime types tailored more to webservers where serving a video with the corrent MIME is more important than a word document |