Documentation ¶
Overview ¶
Package mimetools provides functions for matching against media types
Also referred to ad MIME types, see http://en.wikipedia.org/wiki/Internet_media_type
It primarily exports Matcher:
mm := mimetools.NewMatcher([]string{"text/*", "application/json"}) mm.Match("text/html") // returns true, nil mm.Match("text/plain") //returns true, nil mm.Match("application/json") // returns true, nil mm.Match("application/vnd.ms-excel") // returns false, nil
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher will match Accept or Content-Type mime types that include *
func NewMatcher ¶
NewMatcher returns a new matcher instance and any errors that occurred. Note that if an error is returned, a Matcher is returned that matches any mime type.
Click to show internal directories.
Click to hide internal directories.