Documentation
¶
Index ¶
- Constants
- Variables
- func FileExists(path string) (bool, error)
- func GlobMatch(key1 string, key2 string) (bool, error)
- func GlobMatchFunc(args ...interface{}) (interface{}, error)
- func Hash(rule []string) string
- func IPMatch(ip1 string, ip2 string) bool
- func IsPathPattern(path string) bool
- func IsPathPattern2(path string) bool
- func IsPathPatternHelper(pattern, sep string, prefix, suffix byte) bool
- func Join2D(elems [][]string, sep string) []string
- func PathMatch(path, pattern string) bool
- func PathMatch2(path, pattern string) bool
- func PathMatchHelper(path, pattern, sep string, prefix, suffix byte) bool
- func RegexMatch(key1 string, key2 string) bool
- func ValidateVariadicArgs(expectedLen int, args ...interface{}) error
- func WrapMatchingFunc(fn MatchingFunc) govaluate.ExpressionFunction
- type IMatcher
- type LRUCache
- type Matcher
- type MatchingFunc
- type PrefixMatcher
- type SyncLRUCache
Constants ¶
View Source
const DefaultSep = ","
Variables ¶
View Source
var IPMatchFunc = WrapMatchingFunc(IPMatch)
View Source
var PathMatchFunc = WrapMatchingFunc(PathMatch)
View Source
var PathMatchFunc2 = WrapMatchingFunc(PathMatch2)
View Source
var PathMatcher = NewMatcher(IsPathPattern, PathMatch)
View Source
var PathMatcher2 = NewMatcher(IsPathPattern2, PathMatch2)
View Source
var RegexMatchFunc = WrapMatchingFunc(RegexMatch)
View Source
var RegexMatcher = NewPrefixMatcher(defaultPrefix, RegexMatch)
Functions ¶
func FileExists ¶
func GlobMatchFunc ¶
func GlobMatchFunc(args ...interface{}) (interface{}, error)
GlobMatchFunc is the wrapper for GlobMatch.
func IPMatch ¶
IPMatch determines whether IP address ip1 matches the pattern of IP address ip2, ip2 can be an IP address or a CIDR pattern. For example, "192.168.2.123" matches "192.168.2.0/24"
func IsPathPattern ¶ added in v1.1.0
func IsPathPattern2 ¶ added in v1.1.0
func IsPathPatternHelper ¶ added in v1.1.0
func PathMatch2 ¶
func PathMatchHelper ¶
func RegexMatch ¶
RegexMatch determines whether key1 matches the pattern of key2 in regular expression.
func ValidateVariadicArgs ¶
validate the variadic parameter size and type as string
func WrapMatchingFunc ¶
func WrapMatchingFunc(fn MatchingFunc) govaluate.ExpressionFunction
Types ¶
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
func NewLRUCache ¶
type Matcher ¶ added in v1.1.0
type Matcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶ added in v1.1.0
func NewMatcher(isPatternFn func(str string) bool, matchFn MatchingFunc) *Matcher
type MatchingFunc ¶
type PrefixMatcher ¶ added in v1.1.0
type PrefixMatcher struct {
// contains filtered or unexported fields
}
func NewPrefixMatcher ¶ added in v1.1.0
func NewPrefixMatcher(prefix string, matchFn MatchingFunc) *PrefixMatcher
func (*PrefixMatcher) IsPattern ¶ added in v1.1.0
func (m *PrefixMatcher) IsPattern(str string) bool
func (*PrefixMatcher) Match ¶ added in v1.1.0
func (m *PrefixMatcher) Match(str, pattern string) bool
type SyncLRUCache ¶
type SyncLRUCache struct { *LRUCache // contains filtered or unexported fields }
func NewSyncLRUCache ¶
func NewSyncLRUCache(capacity int) *SyncLRUCache
func (*SyncLRUCache) Get ¶
func (cache *SyncLRUCache) Get(key interface{}) (value interface{}, ok bool)
func (*SyncLRUCache) Put ¶
func (cache *SyncLRUCache) Put(key interface{}, value interface{})
Click to show internal directories.
Click to hide internal directories.