Documentation ¶
Index ¶
- Constants
- Variables
- func Basename(s string) string
- func MimeTypeFromByte(b []byte) (string, error)
- func MimeTypeFromFile(f *os.File) (string, error)
- func MimeTypeFromName(name string) string
- func MimeTypeFromPath(path string) (string, error)
- func SplitMimeType(m string) (major, minor, codec string)
- type ContentDisposition
Constants ¶
View Source
const (
MIME_TYPE_DEFAULT = "application/octet-stream"
)
Variables ¶
View Source
var ( EMimeEmptyContent = errors.New("cannot detect mime type: empty content") EMimeUnidentifiedContent = errors.New("cannot detect mime type: unidentified content") EMimeUnknownExtension = errors.New("cannot detect mime type: unknown extension") )
View Source
var (
TRIMMER_EXTRA_MIMETYPES map[string]string = map[string]string{
".3fr": "image/x-hasselblad-3fr",
".ale": "application/vnd.avid.ale",
".aml": "application/vnd.arri.look",
".ari": "application/vnd.arri.arriraw",
".arw": "image/x-sony-arw",
".cdl": "application/cdl+xml",
".cine": "video/x-cine",
".cr2": "image/x-canon-cr2",
".csv": "text/csv",
".cube": "text/plain",
".data": "text/plain",
".dng": "image/x-adobe-dng",
".dpx": "image/x-dpx",
".edl": "text/plain",
".exr": "image/x-exr",
".flac": "audio/flac",
".jp2": "image/jp2",
".jpx": "image/jpx",
".look": "application/look+xml",
".lut": "text/plain",
".m2ts": "video/mp2t",
".m3u": "application/x-mpegurl",
".m3u8": "application/x-mpegurl",
".mkv": "video/x-matroska",
".mov": "video/quicktime",
".mpd": "application/dash+xml",
".mxf": "application/mxf",
".psd": "image/vnd.adobe.photoshop",
".r3d": "application/vnd.red.redcode",
".rmd": "application/vnd.red.redmetadata",
".srt": "application/x-subrip",
".svg": "image/svg+xml",
".vtt": "text/vtt",
".xmp": "application/rdf+xml",
}
)
Functions ¶
Types ¶
type ContentDisposition ¶
type ContentDisposition struct { Type string // inline, attachement, form-data Lang string // ISO language Charset string // utf-8, .. Tokens map[string]string // name=xx, filename=xx, filename*=xx }
func NewContentDisposition ¶
func NewContentDisposition(t string) *ContentDisposition
func ParseContentDisposition ¶
func ParseContentDisposition(h string) *ContentDisposition
func (*ContentDisposition) Encode ¶
func (c *ContentDisposition) Encode() string
func (*ContentDisposition) Get ¶
func (c *ContentDisposition) Get(token string) string
func (*ContentDisposition) Set ¶
func (c *ContentDisposition) Set(token, value string)
Click to show internal directories.
Click to hide internal directories.