filters

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(whitelist, blacklist FilterFuncs, ev *v1.Event) bool

Apply filters the flow with the given white- and blacklist. Returns true if the flow should be included in the result.

Types

type FilterFunc

type FilterFunc func(ev *v1.Event) bool

FilterFunc is the function will be used to filter the given data. Should return true if the filter is hit, false otherwise.

type FilterFuncs

type FilterFuncs []FilterFunc

FilterFuncs is a combination of multiple filters, typically applied together.

func BuildFilter

func BuildFilter(ff *pb.FlowFilter) (FilterFuncs, error)

BuildFilter builds a filter based on a FlowFilter. It returns:

  • the FilterFunc to be used to filter packets based on the requested FlowFilter;
  • an error in case something went wrong.

func BuildFilterList

func BuildFilterList(ff []*pb.FlowFilter) (FilterFuncs, error)

BuildFilterList constructs a list of filter functions representing the list of FlowFilter. It returns:

  • the FilterFunc to be used to filter packets based on the requested FlowFilter;
  • an error in case something went wrong.

func (FilterFuncs) MatchAll

func (fs FilterFuncs) MatchAll(ev *v1.Event) bool

MatchAll returns true if all the filters match the provided data, i.e. AND.

func (FilterFuncs) MatchNone

func (fs FilterFuncs) MatchNone(ev *v1.Event) bool

MatchNone returns true if none of the filters match the provided data or if no filters are specified, i.e. NOR

func (FilterFuncs) MatchOne

func (fs FilterFuncs) MatchOne(ev *v1.Event) bool

MatchOne returns true if at least one of the filters match the provided data or if no filters are specified, i.e. OR.

Jump to

Keyboard shortcuts

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