Documentation ¶
Index ¶
- func RegisterFilter(name string, fn NewFilterFunc)
- func UnmarshalConfig(table *ast.Table, config interface{}) error
- type AlwaysFalseFilter
- type AlwaysTrueFilter
- type Config
- type ExcludeFilter
- type FileFilter
- type FileFilterConfig
- type Filter
- type FuncFilter
- type IncludeFilter
- type ManualConfig
- type MeasurementFilter
- type NewFilterFunc
- type PatternFilter
- type PatternFilterConfig
- type RawSerieFilter
- type SerieFilter
- type SerieFilterConfig
- type Set
- type StringFilterConfig
- type WhereFilter
- type WhereFilterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFilter ¶
func RegisterFilter(name string, fn NewFilterFunc)
RegisterFilter registers a filter with the given name and config creation callback
func UnmarshalConfig ¶
UnmarshalConfig will unmarshal a Config (either filter.Config or rules.Config) that might contain a Filter field from a toml ast.Table
Types ¶
type AlwaysFalseFilter ¶
type AlwaysFalseFilter struct { }
AlwaysFalseFilter is a Filter that is always false
func (*AlwaysFalseFilter) Filter ¶
func (f *AlwaysFalseFilter) Filter(key []byte) bool
Filter implements Filter interface
type AlwaysTrueFilter ¶
type AlwaysTrueFilter struct { }
AlwaysTrueFilter is a Filter that is always true
func (*AlwaysTrueFilter) Filter ¶
func (f *AlwaysTrueFilter) Filter(key []byte) bool
Filter implements Filter interface
type ExcludeFilter ¶
type ExcludeFilter struct {
// contains filtered or unexported fields
}
ExcludeFilter defines a filter to exclude a list of strings
func NewExcludeFilter ¶
func NewExcludeFilter(excludes []string) *ExcludeFilter
NewExcludeFilter creates a new ExcludeFilter
func (*ExcludeFilter) Filter ¶
func (f *ExcludeFilter) Filter(key []byte) bool
Filter implements the Filter interface
type FileFilter ¶
type FileFilter struct {
// contains filtered or unexported fields
}
FileFilter defines a filter based on a file content
func NewFileFilter ¶
func NewFileFilter(path string) (*FileFilter, error)
NewFileFilter creates a new FileFilter from a path
func (*FileFilter) Filter ¶
func (f *FileFilter) Filter(key []byte) bool
Filter implements Filter interface
type FileFilterConfig ¶
type FileFilterConfig struct {
Path string
}
FileFilterConfig represents the toml configuration for a filter based on file content
func (*FileFilterConfig) Build ¶
func (c *FileFilterConfig) Build() (Filter, error)
Build implements Config interface
func (*FileFilterConfig) Sample ¶
func (c *FileFilterConfig) Sample() string
Sample implements Config interface
type Filter ¶
Filter defines an interface to filter and skip keys when applying rules
func NewStringFilter ¶
func NewStringFilter(config *StringFilterConfig) (Filter, error)
NewStringFilter creates a new StringFilter
type FuncFilter ¶
type FuncFilter struct {
// contains filtered or unexported fields
}
FuncFilter is a filter based on a filtering function
func (*FuncFilter) Filter ¶
func (f *FuncFilter) Filter(key []byte) bool
Filter implements Filter interface
type IncludeFilter ¶
type IncludeFilter struct {
// contains filtered or unexported fields
}
IncludeFilter defines a filter to only include a list of strings
func NewIncludeFilter ¶
func NewIncludeFilter(includes []string) *IncludeFilter
NewIncludeFilter creates a new IncludeFilter
func (*IncludeFilter) Filter ¶
func (f *IncludeFilter) Filter(key []byte) bool
Filter implements the Filter interface
type ManualConfig ¶
ManualConfig represents the toml configuration of a filter that must be unmarshaled manually
type MeasurementFilter ¶
type MeasurementFilter struct {
// contains filtered or unexported fields
}
MeasurementFilter defines a filter restricted to measurement part of a key
func NewMeasurementFilter ¶
func NewMeasurementFilter(filter Filter) *MeasurementFilter
NewMeasurementFilter creates a new MeasurementFilter
func (*MeasurementFilter) Filter ¶
func (f *MeasurementFilter) Filter(key []byte) bool
Filter implements Filter interface
type NewFilterFunc ¶
type NewFilterFunc func() Config
NewFilterFunc represents a callback to register a filter's configuration to be able to load it from toml
type PatternFilter ¶
PatternFilter is a Filter based on regexp
func NewPatternFilter ¶
func NewPatternFilter(pattern string) (*PatternFilter, error)
NewPatternFilter creates a new PatternFilter with the given pattern
func (*PatternFilter) Filter ¶
func (f *PatternFilter) Filter(key []byte) bool
Filter implements the Filter interface
type PatternFilterConfig ¶
type PatternFilterConfig struct {
Pattern string
}
PatternFilterConfig represents the toml configuration of a pattern filter
func (*PatternFilterConfig) Build ¶
func (c *PatternFilterConfig) Build() (Filter, error)
Build implements Config interface
func (*PatternFilterConfig) Sample ¶
func (c *PatternFilterConfig) Sample() string
Sample implement Config interface
type RawSerieFilter ¶
type RawSerieFilter struct {
// contains filtered or unexported fields
}
RawSerieFilter defines a filter restricted to a serie part of a key as raw bytes
func NewRawSerieFilter ¶
func NewRawSerieFilter(filter Filter) *RawSerieFilter
NewRawSerieFilter creates a new RawSerieFilter
func (*RawSerieFilter) Filter ¶
func (f *RawSerieFilter) Filter(key []byte) bool
Filter implements the Filter interface
type SerieFilter ¶
type SerieFilter struct {
// contains filtered or unexported fields
}
SerieFilter defines a filter restricted to the serie and field part of a key
func NewSerieFilter ¶
func NewSerieFilter(measurementFilter Filter, tagsFilter Filter, fieldFilter Filter) *SerieFilter
NewSerieFilter creates a new SerieFilter
func (*SerieFilter) Filter ¶
func (f *SerieFilter) Filter(key []byte) bool
Filter implements Filter interface
type SerieFilterConfig ¶
SerieFilterConfig represents the toml configuration of a SerieFilter
func (*SerieFilterConfig) Build ¶
func (c *SerieFilterConfig) Build() (Filter, error)
Build implements Config interface
func (*SerieFilterConfig) Sample ¶
func (c *SerieFilterConfig) Sample() string
Sample implements Config interface
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set defines a set of filters that must pass
type StringFilterConfig ¶
type StringFilterConfig struct { Contains string ContainsAny string Equal string EqualFold string HasPrefix string HasSuffix string }
StringFilterConfig represents the toml configuration for a filter based on strings functions
func (*StringFilterConfig) Build ¶
func (c *StringFilterConfig) Build() (Filter, error)
Build implements Config interface
func (*StringFilterConfig) Sample ¶
func (c *StringFilterConfig) Sample() string
Sample implements Config interface
type WhereFilter ¶
type WhereFilter struct {
// contains filtered or unexported fields
}
WhereFilter defines a filter to restrict keys based on tag values
func NewWhereFilter ¶
func NewWhereFilter(where map[string]string) (*WhereFilter, error)
NewWhereFilter creates a new WhereFilter based on a map of tags key, value
func (*WhereFilter) Filter ¶
func (f *WhereFilter) Filter(key []byte) bool
Filter implements Filter interface
type WhereFilterConfig ¶
WhereFilterConfig represents toml configuration for WhereFilter
func (*WhereFilterConfig) Build ¶
func (c *WhereFilterConfig) Build() (Filter, error)
Build implements Config interface
func (*WhereFilterConfig) Sample ¶
func (c *WhereFilterConfig) Sample() string
Sample implements Config interface