filters

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidEventArgument added in v0.9.0

func InvalidEventArgument(argument string) error

func InvalidEventName added in v0.9.0

func InvalidEventName(event string) error

func InvalidExpression added in v0.9.0

func InvalidExpression(expression string) error

func InvalidValue added in v0.9.0

func InvalidValue(value string) error

func UnsupportedOperator added in v0.9.0

func UnsupportedOperator(op Operator) error

Types

type ArgFilter

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

func NewArgFilter added in v0.9.0

func NewArgFilter() *ArgFilter

func (*ArgFilter) Disable added in v0.9.0

func (filter *ArgFilter) Disable()

func (*ArgFilter) Enable added in v0.9.0

func (filter *ArgFilter) Enable()

func (*ArgFilter) Enabled

func (filter *ArgFilter) Enabled() bool

func (*ArgFilter) Filter added in v0.9.0

func (filter *ArgFilter) Filter(eventID events.ID, args []trace.Argument) bool

func (*ArgFilter) GetEventFilters added in v0.9.0

func (filter *ArgFilter) GetEventFilters(eventID events.ID) map[string]*eventArgFilter

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

func (*ArgFilter) Parse

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

type BPFStringFilter added in v0.9.0

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

func NewBPFStringFilter added in v0.9.0

func NewBPFStringFilter(mapName string) *BPFStringFilter

func (*BPFStringFilter) InitBPF added in v0.9.0

func (filter *BPFStringFilter) InitBPF(bpfModule *bpf.Module) error

type BPFUIntFilter added in v0.9.0

type BPFUIntFilter struct {
	UIntFilter
	// contains filtered or unexported fields
}

func NewBPFUInt32Filter added in v0.9.0

func NewBPFUInt32Filter(mapName string) *BPFUIntFilter

func NewBPFUIntFilter added in v0.9.0

func NewBPFUIntFilter(mapName string) *BPFUIntFilter

func (*BPFUIntFilter) InitBPF added in v0.9.0

func (filter *BPFUIntFilter) InitBPF(bpfModule *bpf.Module) error

type BoolFilter

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

func NewBoolFilter added in v0.9.0

func NewBoolFilter() *BoolFilter

func (*BoolFilter) Disable added in v0.9.0

func (f *BoolFilter) Disable()

func (*BoolFilter) Enable added in v0.9.0

func (f *BoolFilter) Enable()

func (*BoolFilter) Enabled

func (f *BoolFilter) Enabled() bool

func (*BoolFilter) Filter added in v0.9.0

func (filter *BoolFilter) Filter(val bool) bool

func (*BoolFilter) FilterOut

func (filter *BoolFilter) FilterOut() bool

func (*BoolFilter) Parse

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

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

func (*BoolFilter) Value

func (filter *BoolFilter) Value() bool

type ContainerFilter added in v0.9.0

type ContainerFilter struct {
	*BPFStringFilter
}

func NewContainerFilter added in v0.9.0

func NewContainerFilter(mapName string) *ContainerFilter

func (*ContainerFilter) InitBPF added in v0.9.0

func (f *ContainerFilter) InitBPF(bpfModule *bpf.Module, containers *containers.Containers) error

type Filter added in v0.9.0

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

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

type IntFilter

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

func NewInt32Filter added in v0.9.0

func NewInt32Filter() *IntFilter

func NewIntFilter added in v0.9.0

func NewIntFilter() *IntFilter

func (*IntFilter) Disable added in v0.9.0

func (f *IntFilter) Disable()

func (*IntFilter) Enable added in v0.9.0

func (f *IntFilter) Enable()

func (*IntFilter) Enabled

func (f *IntFilter) Enabled() bool

func (*IntFilter) Filter added in v0.9.0

func (f *IntFilter) Filter(val int64) bool

priority goes by (from most significant): 1. equality 2. greater 3. lesser 4. non equality

func (*IntFilter) Maximum added in v0.9.0

func (f *IntFilter) Maximum() int64

func (*IntFilter) Minimum added in v0.9.0

func (f *IntFilter) Minimum() int64

func (*IntFilter) Parse

func (filter *IntFilter) Parse(operatorAndValues string) error

type Operator added in v0.9.0

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

func (Operator) String added in v0.9.0

func (o Operator) String() string

type ProcessTreeFilter

type ProcessTreeFilter struct {
	PIDs map[uint32]bool // PIDs is a map where k=pid and v represents whether it and its descendents should be traced or not
	// contains filtered or unexported fields
}

func NewProcessTreeFilter added in v0.9.0

func NewProcessTreeFilter(mapName string) *ProcessTreeFilter

func (*ProcessTreeFilter) Disable added in v0.9.0

func (f *ProcessTreeFilter) Disable()

func (*ProcessTreeFilter) Enable added in v0.9.0

func (f *ProcessTreeFilter) Enable()

func (*ProcessTreeFilter) Enabled

func (f *ProcessTreeFilter) Enabled() bool

func (*ProcessTreeFilter) FilterOut

func (filter *ProcessTreeFilter) FilterOut() bool

func (*ProcessTreeFilter) InitBPF added in v0.9.0

func (filter *ProcessTreeFilter) InitBPF(bpfModule *bpf.Module) error

func (*ProcessTreeFilter) Parse

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

type RetFilter

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

func NewRetFilter added in v0.9.0

func NewRetFilter() *RetFilter

func (*RetFilter) Disable added in v0.9.0

func (filter *RetFilter) Disable()

func (*RetFilter) Enable added in v0.9.0

func (filter *RetFilter) Enable()

func (*RetFilter) Enabled

func (filter *RetFilter) Enabled() bool

func (*RetFilter) Filter added in v0.9.0

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 StringFilter

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

func NewStringFilter added in v0.9.0

func NewStringFilter() *StringFilter

func (*StringFilter) Disable added in v0.9.0

func (f *StringFilter) Disable()

func (*StringFilter) Enable added in v0.9.0

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) Filter added in v0.9.0

func (f *StringFilter) Filter(val string) bool

priority goes by (from most significant): 1. equality, suffixed, prefixed, contains 2. not equals, not suffixed, not prefixed, not contains This is done so if a conflicting "not" filter exists, we ignore it

func (*StringFilter) FilterOut

func (filter *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 UIntFilter

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

func NewUInt32Filter added in v0.9.0

func NewUInt32Filter() *UIntFilter

func NewUIntFilter added in v0.9.0

func NewUIntFilter() *UIntFilter

func (*UIntFilter) Disable added in v0.9.0

func (f *UIntFilter) Disable()

func (*UIntFilter) Enable added in v0.9.0

func (f *UIntFilter) Enable()

func (*UIntFilter) Enabled

func (f *UIntFilter) Enabled() bool

func (*UIntFilter) Filter added in v0.9.0

func (f *UIntFilter) Filter(val uint64) bool

priority goes by (from most significant): 1. equality 2. greater 3. lesser 4. non equality

func (*UIntFilter) FilterOut

func (filter *UIntFilter) FilterOut() bool

func (*UIntFilter) Maximum added in v0.9.0

func (f *UIntFilter) Maximum() uint64

func (*UIntFilter) Minimum added in v0.9.0

func (f *UIntFilter) Minimum() uint64

func (*UIntFilter) Parse

func (filter *UIntFilter) Parse(operatorAndValues string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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