libmime

package
v2.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: BSD-3-Clause Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Patch

func Patch(additional map[string]string)

Patch patches the mime types Go uses by calling mime.AddExtensionType on each from a builtin list in this package. Optionally, provide a non-nil additional map (ext->mimeType) to add additional mime types. The additional mime types are added after the builtin ones, and both builtin ones and the additional ones are added after the `mime` package loads from a few filesystem locations such as /etc/apache2/mime.types. In other words, the overriding precedence is:

filesystem -> builtin in this package -> optional additional parameter

where the ones on right side can override what's from ones on the left side.

Note that due to unpredictibility of what's on the device's file system, merely using this function may not be enough if you want to override a particular mime type (e.g. text/javascript). To do so you should check the determined mime type at a later time, e.g. before writing the HTTP response.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL