Documentation ¶
Overview ¶
mimetools.Matcher allows matching against wildcard mediaTypes.
Example: 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.