var ErrNotMatch … var ErrInvalidPattern … type MalformedSequenceError … func (e MalformedSequenceError) Error() string { … } type op … type Pattern … // 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) (Pattern, error) { … } // MustPattern is a helper function which makes it easier to call NewPattern in variable initialization. func MustPattern(p Pattern, err error) Pattern { … } // MatchAndEscape examines components to determine if they match to a Pattern. // MatchAndEscape will return an error if no Patterns matched or if a pattern // matched but contained malformed escape sequences. If successful, the function // returns a mapping from field paths to their captured values. func (p Pattern) MatchAndEscape(components []string, verb string, unescapingMode UnescapingMode) (map[string]string, error) { … } // MatchAndEscape examines components to determine if they match to a Pattern. // It will never perform per-component unescaping (see: UnescapingModeLegacy). // MatchAndEscape will return an error if no Patterns matched. If successful, // the function returns a mapping from field paths to their captured values. // // Deprecated: Use MatchAndEscape. 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 { … } // ishex returns whether or not the given byte is a valid hex character func ishex(c byte) bool { … } func isRFC6570Reserved(c byte) bool { … } // unhex converts a hex point to the bit representation func unhex(c byte) byte { … } // shouldUnescapeWithMode returns true if the character is escapable with the // given mode func shouldUnescapeWithMode(c byte, mode UnescapingMode) bool { … } // unescape unescapes a path string using the provided mode func unescape(s string, mode UnescapingMode, multisegment bool) (string, error) { … }