var ErrNotMatch … var ErrInvalidPattern … type op … type Pattern … type patternOptions … type PatternOpt … // NewPattern returns a new Pattern from the given definition values. // "ops" is a sequence of op codes. "pool" is a constant pool. // "verb" is the verb part of the pattern. It is empty if the pattern does not have the part. // "version" must be 1 for now. // It returns an error if the given definition is invalid. func NewPattern(version int, ops []int, pool []string, verb string, opts ...PatternOpt) (Pattern, error) { … } // MustPattern is a helper function which makes it easier to call NewPattern in variable initialization. func MustPattern(p Pattern, err error) Pattern { … } // Match examines components if it matches to the Pattern. // If it matches, the function returns a mapping from field paths to their captured values. // If otherwise, the function returns an error. func (p Pattern) Match(components []string, verb string) (map[string]string, error) { … } // Verb returns the verb part of the Pattern. func (p Pattern) Verb() string { … } func (p Pattern) String() string { … } // AssumeColonVerbOpt indicates whether a path suffix after a final // colon may only be interpreted as a verb. func AssumeColonVerbOpt(val bool) PatternOpt { … }