Documentation
¶
Index ¶
- func GlobalParamsCollection() params.Collection
- func Register(operator Operator)
- type ContainerInfoFromMountNSID
- type ContainerInfoFromNetNSID
- type ContainerInfoGetters
- type ContainerInfoSetters
- type EnricherFunc
- type GadgetContext
- type Operator
- type OperatorInstance
- type OperatorInstances
- type Operators
- func (e Operators) Close()
- func (e Operators) Init(pc params.Collection) error
- func (e Operators) Instantiate(gadgetContext GadgetContext, trace any, ...) (operatorInstances OperatorInstances, _ error)
- func (e Operators) ParamCollection() params.Collection
- func (e Operators) ParamDescCollection() params.DescCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalParamsCollection ¶
func GlobalParamsCollection() params.Collection
GlobalParamsCollection returns a collection of params of all registered operators
Types ¶
type ContainerInfoFromMountNSID ¶
type ContainerInfoFromMountNSID interface { ContainerInfoSetters GetMountNSID() uint64 }
ContainerInfoFromMountNSID is a typical kubernetes operator interface that adds node, pod, namespace and container information given the MountNSID
type ContainerInfoFromNetNSID ¶
type ContainerInfoFromNetNSID interface { ContainerInfoSetters GetNetNSID() uint64 }
type ContainerInfoGetters ¶ added in v0.15.0
type ContainerInfoSetters ¶
type EnricherFunc ¶
type GadgetContext ¶
type Operator ¶
type Operator interface { // Name must return a unique name for the operator Name() string // Description is an optional description to show to the user Description() string // GlobalParamDescs will return global params (required) for this operator GlobalParamDescs() params.ParamDescs // ParamDescs will return params (required) per gadget instance of the operator ParamDescs() params.ParamDescs // Dependencies can list other operators that this operator depends on Dependencies() []string // CanOperateOn should test whether the operator supports the given gadget. Init has not // necessarily been called at this point. CanOperateOn(gadgets.GadgetDesc) bool // Init allows the operator to initialize itself Init(params *params.Params) error // Close allows the operator to clean up stuff prior to exiting Close() error // Instantiate is called before a gadget is run with this operator. // This must return something that implements OperatorInstance. // This is useful to create a context for an operator by wrapping it. // Params given here are the ones returned by ParamDescs() Instantiate(gadgetContext GadgetContext, gadgetInstance any, params *params.Params) (OperatorInstance, error) }
type OperatorInstance ¶
type OperatorInstance interface { // Name returns the name of the operator instance Name() string // PreGadgetRun in called before a gadget is run PreGadgetRun() error // PostGadgetRun is called after a gadget is run PostGadgetRun() error // EnrichEvent enriches the given event with additional data EnrichEvent(ev any) error }
type OperatorInstances ¶
type OperatorInstances []OperatorInstance
func (OperatorInstances) Enrich ¶
func (oi OperatorInstances) Enrich(ev any) error
Enrich an event using all members of the operator collection
func (OperatorInstances) PostGadgetRun ¶
func (oi OperatorInstances) PostGadgetRun() error
func (OperatorInstances) PreGadgetRun ¶
func (oi OperatorInstances) PreGadgetRun() error
type Operators ¶
type Operators []Operator
func GetOperatorsForGadget ¶
func GetOperatorsForGadget(gadget gadgets.GadgetDesc) Operators
GetOperatorsForGadget checks which operators can work with the given gadgets and returns a collection of them
func SortOperators ¶
SortOperators builds a dependency tree of the given operator collection and sorts them by least dependencies first Returns an error, if there are loops or missing dependencies
func (Operators) Close ¶
func (e Operators) Close()
Close closes all operators in the collection; errors will be written to the log
func (Operators) Init ¶
func (e Operators) Init(pc params.Collection) error
Init initializes all operators in the collection using their respective params
func (Operators) Instantiate ¶
func (e Operators) Instantiate(gadgetContext GadgetContext, trace any, perGadgetParamCollection params.Collection) (operatorInstances OperatorInstances, _ error)
Instantiate calls Instantiate on all operators and returns a collection of the results. It also calls PreGadgetRun on all instances.
func (Operators) ParamCollection ¶
func (e Operators) ParamCollection() params.Collection
ParamCollection returns a collection of parameters for all members of the operator collection
func (Operators) ParamDescCollection ¶
func (e Operators) ParamDescCollection() params.DescCollection
ParamDescCollection returns a collection of parameter descriptors for all members of the operator collection
Directories
¶
Path | Synopsis |
---|---|
Package kubeipresolver provides an operator that enriches events by looking up IP addresses in Kubernetes resources such as pods and services.
|
Package kubeipresolver provides an operator that enriches events by looking up IP addresses in Kubernetes resources such as pods and services. |