Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ANY is the pattern which allows any value. ANY matchKey = 0 // HEAD is the pattern for start element of silce. HEAD matchKey = 1 // TAIL is the pattern for end element(s) of slice. TAIL matchKey = 2 )
Variables ¶
This section is empty.
Functions ¶
func OneOf ¶
func OneOf(items ...interface{}) oneOfContainer
OneOf defines the pattern where at least one item matches.
func RegisterMatcher ¶
func RegisterMatcher(pattern PatternChecker)
RegisterMatcher register custom pattern.
Types ¶
type MatchItem ¶
type MatchItem struct {
// contains filtered or unexported fields
}
MatchItem defines a matched item value.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher struct
type PatternChecker ¶
type PatternChecker func(pattern interface{}, value interface{}) bool
PatternChecker is func for checking pattern.
Click to show internal directories.
Click to hide internal directories.