Documentation ¶
Index ¶
Constants ¶
View Source
const ( ApplicationMediaType = "application" OctetStreamMediaSubtype = "octet-stream" TextMediaType = "text" PlainMediaSubtype = "plain" JsonMediaSubtype = "json" XmlMediaSubtype = "xml" ContentTypeHeaderKey = "Content-Type" )
Variables ¶
View Source
var ( ApplicationOctetStream = &ContentType{ MediaType: ApplicationMediaType, MediaSubtype: OctetStreamMediaSubtype, } TextPlain = &ContentType{ MediaType: TextMediaType, MediaSubtype: PlainMediaSubtype, } ApplicationJson = &ContentType{ MediaType: ApplicationMediaType, MediaSubtype: JsonMediaSubtype, } ApplicationXml = &ContentType{ MediaType: ApplicationMediaType, MediaSubtype: XmlMediaSubtype, } )
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType struct { MediaType string MediaSubtype string // contains filtered or unexported fields }
func New ¶
func New(mediaType, mediaSubtype string) *ContentType
func Parse ¶
func Parse(ct string) (*ContentType, error)
func (*ContentType) MarshalJSON ¶
func (ct *ContentType) MarshalJSON() ([]byte, error)
func (*ContentType) String ¶
func (ct *ContentType) String() string
type ContentTypeMap ¶
type ContentTypeMap map[ContentType]interface{}
func (ContentTypeMap) Get ¶
func (c ContentTypeMap) Get(key ContentType) (interface{}, bool)
Click to show internal directories.
Click to hide internal directories.