Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExcludeFilterFields ¶
func ExcludeFilterFields() docs.FieldSpecs
ExcludeFilterFields returns a docs spec for the fields within a metadata config struct.
func IncludeFilterDocs ¶
func IncludeFilterDocs() docs.FieldSpecs
IncludeFilterDocs returns a docs spec for a metadata filter where keys are ignored by default and must be explicitly included.
Types ¶
type ExcludeFilter ¶
type ExcludeFilter struct {
// contains filtered or unexported fields
}
ExcludeFilter provides a way to filter metadata keys based on a Metadata config.
type ExcludeFilterConfig ¶
type ExcludeFilterConfig struct {
ExcludePrefixes []string `json:"exclude_prefixes" yaml:"exclude_prefixes"`
}
ExcludeFilterConfig describes actions to be performed on message metadata before being sent to an output destination.
func NewExcludeFilterConfig ¶
func NewExcludeFilterConfig() ExcludeFilterConfig
NewExcludeFilterConfig returns a Metadata configuration struct with default values.
func (ExcludeFilterConfig) Filter ¶
func (m ExcludeFilterConfig) Filter() (*ExcludeFilter, error)
Filter attempts to construct a metadata filter.
type IncludeFilter ¶
type IncludeFilter struct {
// contains filtered or unexported fields
}
IncludeFilter provides a way to filter keys based on a Config.
func (*IncludeFilter) IsSet ¶
func (f *IncludeFilter) IsSet() bool
IsSet returns true if there are any rules configured for matching keys.
func (*IncludeFilter) Iter ¶
Iter applies a function to each metadata key value pair that passes the filter.
func (*IncludeFilter) IterStr ¶ added in v4.10.0
IterStr applies a function to each metadata key value pair that passes the filter with the value serialised as a string.
func (*IncludeFilter) Match ¶
func (f *IncludeFilter) Match(str string) bool
Match returns true if the provided string matches the configured filters and false otherwise. It also returns false if no filters are configured.
type IncludeFilterConfig ¶
type IncludeFilterConfig struct { IncludePrefixes []string `json:"include_prefixes" yaml:"include_prefixes"` IncludePatterns []string `json:"include_patterns" yaml:"include_patterns"` }
IncludeFilterConfig contains configuration fields for a metadata filter where keys are ignored by default and must be explicitly included.
func NewIncludeFilterConfig ¶
func NewIncludeFilterConfig() IncludeFilterConfig
NewIncludeFilterConfig returns an IncludeFilterConfig struct with default values.
func (IncludeFilterConfig) CreateFilter ¶
func (c IncludeFilterConfig) CreateFilter() (*IncludeFilter, error)
CreateFilter attempts to construct a filter object.