Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtensionByType ¶
Preferred file extension with its leading dot for a media type, matched without regard to case, parameters or surrounding space: the built-in table's for every type it holds, else the alphabetically first the host knows through the standard mime package, "" when neither knows the type
func IsText ¶
Whether a media type, parameters ignored, carries text: any text type, any +json, +xml or +yaml type, the textual application types (JSON, XML, YAML, TOML, JavaScript, SQL, shell, PHP, TeX, troff, Tcl, RDF, HLS playlist, MIF, WAIS source) and mail messages
func TypeByExtension ¶
Media type of a file extension given with its leading dot, matched without regard to case: the built-in table's type for every extension it holds, else the host's through the standard mime package (the shared MIME database or mime.types files on Unix, the registry on Windows) with parameters such as charset cut, "" when neither knows it
func TypeByName ¶
Media type of a file name or path from the extension of its last element as TypeByExtension types it, "" when it has no known one; a leading dot starts no extension, so .png is a name, and a compressed file is typed by its compression (x.tar.gz is application/gzip)
func TypeByURL ¶
Media type of a URL, the declared type of a data URL (text/plain when it declares none or an invalid one, "" without its comma), else the type of the URL path's last segment with any query, fragment and ;parameters cut; text with no scheme of two or more characters is a file name or path as TypeByName reads it
Types ¶
This section is empty.