filters

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxNotSetUInt uint64 = 0
	MinNotSetUInt uint64 = math.MaxUint64
)

Variables

This section is empty.

Functions

func FailedToRetreiveHostNS

func FailedToRetreiveHostNS() error

func InvalidEventData added in v0.20.0

func InvalidEventData(data string) error

func InvalidEventName

func InvalidEventName(event string) error

func InvalidExpression

func InvalidExpression(expression string) error

func InvalidPolicy

func InvalidPolicy(policy string) error

func InvalidScopeField added in v0.20.0

func InvalidScopeField(field string) error

func InvalidValue

func InvalidValue(value string) error

func UnsupportedOperator

func UnsupportedOperator(op Operator) error

Types

type BinaryFilter

type BinaryFilter struct {
	// contains filtered or unexported fields
}

func NewBinaryFilter

func NewBinaryFilter() *BinaryFilter

func (*BinaryFilter) Clone added in v0.20.0

func (f *BinaryFilter) Clone() *BinaryFilter

func (*BinaryFilter) Disable

func (f *BinaryFilter) Disable()

func (*BinaryFilter) Enable

func (f *BinaryFilter) Enable()

func (*BinaryFilter) Enabled

func (f *BinaryFilter) Enabled() bool

func (*BinaryFilter) Equalities added in v0.20.0

func (f *BinaryFilter) Equalities() BinaryFilterEqualities

func (*BinaryFilter) FilterOut

func (f *BinaryFilter) FilterOut() bool

func (*BinaryFilter) Parse

func (f *BinaryFilter) Parse(operatorAndValues string) error

type BinaryFilterEqualities added in v0.20.0

type BinaryFilterEqualities struct {
	Equal    map[NSBinary]struct{}
	NotEqual map[NSBinary]struct{}
}

type BoolFilter

type BoolFilter struct {
	// contains filtered or unexported fields
}

func NewBoolFilter

func NewBoolFilter() *BoolFilter

func (*BoolFilter) Clone added in v0.20.0

func (f *BoolFilter) Clone() *BoolFilter

func (*BoolFilter) Disable

func (f *BoolFilter) Disable()

func (*BoolFilter) Enable

func (f *BoolFilter) Enable()

func (*BoolFilter) Enabled

func (f *BoolFilter) Enabled() bool

func (*BoolFilter) Filter

func (f *BoolFilter) Filter(val interface{}) bool

func (*BoolFilter) FilterOut

func (f *BoolFilter) FilterOut() bool

func (*BoolFilter) Parse

func (f *BoolFilter) Parse(operatorAndValues string) error

BoolFilter can support the following expressions values in <> are ignored field -> field=true not-field -> field=false field=true field=false field!=true field!=false

func (*BoolFilter) Value

func (f *BoolFilter) Value() bool

type DataFilter added in v0.20.0

type DataFilter struct {
	// contains filtered or unexported fields
}

func NewDataFilter added in v0.20.0

func NewDataFilter() *DataFilter

func (*DataFilter) Clone added in v0.20.0

func (af *DataFilter) Clone() *DataFilter

func (*DataFilter) Disable added in v0.20.0

func (af *DataFilter) Disable()

func (*DataFilter) Enable added in v0.20.0

func (af *DataFilter) Enable()

func (*DataFilter) Enabled added in v0.20.0

func (af *DataFilter) Enabled() bool

func (*DataFilter) Filter added in v0.20.0

func (af *DataFilter) Filter(eventID events.ID, data []trace.Argument) bool

func (*DataFilter) GetEventFilters added in v0.20.0

func (af *DataFilter) GetEventFilters(eventID events.ID) map[string]Filter[*StringFilter]

GetEventFilters returns the data filters map for a specific event writing to the map may have unintentional consequences, avoid doing so

func (*DataFilter) Parse added in v0.20.0

func (af *DataFilter) Parse(filterName string, operatorAndValues string, eventsNameToID map[string]events.ID) error

type Filter

type Filter[T any] interface {
	Clone() T

	Filter(val interface{}) bool
	Parse(operatorAndValues string) error
	Enable()
	Disable()
	Enabled() bool
}

This is a generic representation which cannot be implemented With generics this may be a viable interface, with U replacing interface{} Filters can be enabled or disabled - if a filter is enabled it will be skipped

type IntFilter

type IntFilter[T constraints.Signed] struct {
	// contains filtered or unexported fields
}

func NewInt32Filter

func NewInt32Filter() *IntFilter[int32]

func NewIntFilter

func NewIntFilter() *IntFilter[int64]

func (*IntFilter[T]) Clone added in v0.20.0

func (f *IntFilter[T]) Clone() *IntFilter[T]

func (*IntFilter[T]) Disable

func (f *IntFilter[T]) Disable()

func (*IntFilter[T]) Enable

func (f *IntFilter[T]) Enable()

func (*IntFilter[T]) Enabled

func (f *IntFilter[T]) Enabled() bool

func (*IntFilter[T]) Filter

func (f *IntFilter[T]) Filter(val interface{}) bool

func (*IntFilter[T]) Maximum

func (f *IntFilter[T]) Maximum() int64

func (*IntFilter[T]) Minimum

func (f *IntFilter[T]) Minimum() int64

func (*IntFilter[T]) Parse

func (f *IntFilter[T]) Parse(operatorAndValues string) error

type NSBinary added in v0.20.0

type NSBinary struct {
	MntNS uint32
	Path  string
}

type Operator

type Operator uint
const (
	Equal Operator = iota
	NotEqual
	Lower
	LowerEqual
	Greater
	GreaterEqual
)

func (Operator) String

func (o Operator) String() string

type ProcessTreeFilter

type ProcessTreeFilter struct {
	// contains filtered or unexported fields
}

func NewProcessTreeFilter

func NewProcessTreeFilter() *ProcessTreeFilter

func (*ProcessTreeFilter) Clone added in v0.20.0

func (*ProcessTreeFilter) Disable

func (f *ProcessTreeFilter) Disable()

func (*ProcessTreeFilter) Enable

func (f *ProcessTreeFilter) Enable()

func (*ProcessTreeFilter) Enabled

func (f *ProcessTreeFilter) Enabled() bool

func (*ProcessTreeFilter) Equalities added in v0.20.0

func (*ProcessTreeFilter) FilterOut

func (f *ProcessTreeFilter) FilterOut() bool

func (*ProcessTreeFilter) Parse

func (f *ProcessTreeFilter) Parse(operatorAndValues string) error

type ProcessTreeFilterEqualities added in v0.20.0

type ProcessTreeFilterEqualities struct {
	Equal    map[uint32]struct{}
	NotEqual map[uint32]struct{}
}

type RetFilter

type RetFilter struct {
	// contains filtered or unexported fields
}

func NewRetFilter

func NewRetFilter() *RetFilter

func (*RetFilter) Clone added in v0.20.0

func (filter *RetFilter) Clone() *RetFilter

func (*RetFilter) Disable

func (filter *RetFilter) Disable()

func (*RetFilter) Enable

func (filter *RetFilter) Enable()

func (*RetFilter) Enabled

func (filter *RetFilter) Enabled() bool

func (*RetFilter) Filter

func (filter *RetFilter) Filter(eventID events.ID, retVal int64) bool

func (*RetFilter) Parse

func (filter *RetFilter) Parse(filterName string, operatorAndValues string, eventsNameToID map[string]events.ID) error

type ScopeFilter added in v0.20.0

type ScopeFilter struct {
	// contains filtered or unexported fields
}

func NewScopeFilter added in v0.20.0

func NewScopeFilter() *ScopeFilter

func (*ScopeFilter) Clone added in v0.20.0

func (filter *ScopeFilter) Clone() *ScopeFilter

func (*ScopeFilter) Disable added in v0.20.0

func (filter *ScopeFilter) Disable()

func (*ScopeFilter) Enable added in v0.20.0

func (filter *ScopeFilter) Enable()

func (*ScopeFilter) Enabled added in v0.20.0

func (filter *ScopeFilter) Enabled() bool

func (*ScopeFilter) Filter added in v0.20.0

func (filter *ScopeFilter) Filter(event trace.Event) bool

func (*ScopeFilter) Parse added in v0.20.0

func (filter *ScopeFilter) Parse(filterName string, operatorAndValues string) error

type StringFilter

type StringFilter struct {
	// contains filtered or unexported fields
}

func NewStringFilter

func NewStringFilter(valHandler ValueHandler) *StringFilter

func (*StringFilter) Clone added in v0.20.0

func (f *StringFilter) Clone() *StringFilter

func (*StringFilter) Disable

func (f *StringFilter) Disable()

func (*StringFilter) Enable

func (f *StringFilter) Enable()

func (*StringFilter) Enabled

func (f *StringFilter) Enabled() bool

func (*StringFilter) Equal

func (f *StringFilter) Equal() []string

Equals returns all equality check values - direct, prefixed and suffixed

func (*StringFilter) Equalities added in v0.20.0

func (f *StringFilter) Equalities() StringFilterEqualities

func (*StringFilter) Filter

func (f *StringFilter) Filter(val interface{}) bool

func (*StringFilter) FilterOut

func (f *StringFilter) FilterOut() bool

func (*StringFilter) NotEqual

func (f *StringFilter) NotEqual() []string

NotEquals returns all non-equality check values - direct, prefixed and suffixed

func (*StringFilter) Parse

func (f *StringFilter) Parse(operatorAndValues string) error

type StringFilterEqualities added in v0.20.0

type StringFilterEqualities struct {
	Equal    map[string]struct{}
	NotEqual map[string]struct{}
}

type UIntFilter

type UIntFilter[T constraints.Unsigned] struct {
	// contains filtered or unexported fields
}

func NewUInt32Filter

func NewUInt32Filter() *UIntFilter[uint32]

func NewUIntFilter

func NewUIntFilter() *UIntFilter[uint64]

func (*UIntFilter[T]) Clone added in v0.20.0

func (f *UIntFilter[T]) Clone() *UIntFilter[T]

func (*UIntFilter[T]) Disable

func (f *UIntFilter[T]) Disable()

func (*UIntFilter[T]) Enable

func (f *UIntFilter[T]) Enable()

func (*UIntFilter[T]) Enabled

func (f *UIntFilter[T]) Enabled() bool

func (*UIntFilter[T]) Equalities added in v0.20.0

func (f *UIntFilter[T]) Equalities() UIntFilterEqualities

func (*UIntFilter[T]) Filter

func (f *UIntFilter[T]) Filter(val interface{}) bool

func (*UIntFilter[T]) FilterOut

func (f *UIntFilter[T]) FilterOut() bool

func (UIntFilter[T]) InMinMaxRange

func (f UIntFilter[T]) InMinMaxRange(val T) bool

func (*UIntFilter[T]) Maximum

func (f *UIntFilter[T]) Maximum() uint64

func (*UIntFilter[T]) Minimum

func (f *UIntFilter[T]) Minimum() uint64

func (*UIntFilter[T]) Parse

func (f *UIntFilter[T]) Parse(operatorAndValues string) error

type UIntFilterEqualities added in v0.20.0

type UIntFilterEqualities struct {
	Equal    map[uint64]struct{}
	NotEqual map[uint64]struct{}
}

type ValueHandler added in v0.20.0

type ValueHandler func(string) (string, error)

ValueHandler is a function that can be passed to StringFilter to handle values when they are parsed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL