Documentation ¶
Index ¶
- type Filter
- func Compile(filters []string, separators ...rune) (Filter, error)
- func MustCompile(filters []string, separators ...rune) Filter
- func NewIncludeExcludeFilter(include []string, exclude []string) (Filter, error)
- func NewIncludeExcludeFilterDefaults(include []string, exclude []string, includeDefault bool, excludeDefault bool) (Filter, error)
- type IncludeExcludeFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
func Compile ¶
Compile takes a list of string filters and returns a Filter interface for matching a given string against the filter list. The filter list supports glob matching with separators too, ie:
f, _ := Compile([]string{"cpu", "mem", "net*"}) f.Match("cpu") // true f.Match("network") // true f.Match("memory") // false
separators are only to be used for globbing filters, ie:
f, _ := Compile([]string{"cpu.*.count"}, '.') f.Match("cpu.count") // false f.Match("cpu.measurement.count") // true f.Match("cpu.field.measurement.count") // false
Compile will return nil if the filter list is empty.
func MustCompile ¶ added in v1.24.0
func NewIncludeExcludeFilter ¶
type IncludeExcludeFilter ¶
type IncludeExcludeFilter struct {
// contains filtered or unexported fields
}
func (*IncludeExcludeFilter) Match ¶
func (f *IncludeExcludeFilter) Match(s string) bool
Click to show internal directories.
Click to hide internal directories.