Documentation ¶
Overview ¶
Package mime defines commonly used mime types in Jenny
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type string
Type repreents a mimeType
const ( // TextPlain default mimeType for a lot of things TextPlain Type = "text/plain" // ApplicationJSON application/json type ApplicationJSON Type = "application/json" // ApplicationXML application/xml type ApplicationXML Type = "application/xml" // ApplicationOctet application/octet-stream type, for generic stuff ApplicationOctet Type = "application/octet-stream" // ApplicationFormURLEncoded for form encoded stuff ApplicationFormURLEncoded Type = "application/x-www-form-urlencoded" )
type Types ¶
Types represents a collection of mimeTypes
func Aggregate ¶
Aggregate takes a array of mime.Type as strings and builds a mime.Types from it elements of the array have to be in <type>/<subType> format. Weights are not supported.
func Intersect ¶
Intersect takes two mime.Types and returns the intersection of two Types'
'A' and 'B' and writes each element thats present in both Typess to a new Types. In the result grpah, weights of the node are derived from Types 'B' text/html, text/plain;q=0.9 text/troff, text/html;q=0.9 +-TypesA--------------------+ +-TypesB--------------------+ | text | | text | | + | | + | | | | | | | | plain <------+----> html | | html <--------+---> troff | | + + | | + + | | | | | | | | | | | | | | | | | | v v | | v v | | 0.9 1.0 | | 0.9 1.0 | +---------------------------+ +---------------------------+ +-result----------------+ | text | | + | | | | | v | | html | | + | | | | | v | | 0.9 | +-----------------------+
func RequestTypes ¶
RequestTypes takes a http.Request and builds a mimeTypes from it.
Click to show internal directories.
Click to hide internal directories.