Documentation
¶
Index ¶
- func ContainerSelectorFromContainerFilter(f *gadgetv1alpha1.ContainerFilter) *containercollection.ContainerSelector
- func TraceName(namespace, name string) string
- func TraceNameFromNamespacedName(n types.NamespacedName) string
- type BaseFactory
- func (f *BaseFactory) Delete(name string)
- func (f *BaseFactory) Initialize(r GadgetHelpers, c client.Client)
- func (f *BaseFactory) Lookup(name string) (interface{}, error)
- func (f *BaseFactory) LookupOrCreate(name string, newTrace func() interface{}) interface{}
- func (f *BaseFactory) Operations() map[gadgetv1alpha1.Operation]TraceOperation
- func (f *BaseFactory) OutputModesSupported() map[gadgetv1alpha1.TraceOutputMode]struct{}
- type GadgetHelpers
- type TraceFactory
- type TraceFactoryWithDocumentation
- type TraceFactoryWithScheme
- type TraceOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerSelectorFromContainerFilter ¶
func ContainerSelectorFromContainerFilter(f *gadgetv1alpha1.ContainerFilter) *containercollection.ContainerSelector
func TraceNameFromNamespacedName ¶
func TraceNameFromNamespacedName(n types.NamespacedName) string
Types ¶
type BaseFactory ¶
type BaseFactory struct { Helpers GadgetHelpers Client client.Client // DeleteTrace is optionally set by gadgets if they need to do // specialised clean up. Example: // // func NewFactory() gadgets.TraceFactory { // return &TraceFactory{ // BaseFactory: gadgets.BaseFactory{DeleteTrace: deleteTrace}, // } // } DeleteTrace func(name string, trace interface{}) // contains filtered or unexported fields }
func (*BaseFactory) Delete ¶
func (f *BaseFactory) Delete(name string)
func (*BaseFactory) Initialize ¶
func (f *BaseFactory) Initialize(r GadgetHelpers, c client.Client)
func (*BaseFactory) Lookup ¶ added in v0.11.0
func (f *BaseFactory) Lookup(name string) (interface{}, error)
func (*BaseFactory) LookupOrCreate ¶
func (f *BaseFactory) LookupOrCreate(name string, newTrace func() interface{}) interface{}
func (*BaseFactory) Operations ¶
func (f *BaseFactory) Operations() map[gadgetv1alpha1.Operation]TraceOperation
func (*BaseFactory) OutputModesSupported ¶
func (f *BaseFactory) OutputModesSupported() map[gadgetv1alpha1.TraceOutputMode]struct{}
type GadgetHelpers ¶
type GadgetHelpers interface { containercollection.ContainerResolver gadgets.DataEnricherByMntNs gadgets.DataEnricherByNetNs gadgets.DataNodeEnricher PublishEvent(tracerID string, line string) error TracerMountNsMap(tracerID string) (*ebpf.Map, error) ContainersMap() *ebpf.Map }
GadgetHelpers provides different functions that are used in the gadgets implementation.
type TraceFactory ¶
type TraceFactory interface { // Initialize gives the Helpers and the Client to the gadget. Gadgets // don't need to implement this method if they use BaseFactory as an // anonymous field. Initialize(Helpers GadgetHelpers, Client client.Client) // Delete request a gadget to release the information it has about a // trace. BaseFactory implements this method, so gadgets who embed // BaseFactory don't need to implement it. Delete(name string) // Operations gives the list of operations on a gadget that users can // call via the gadget.kinvolk.io/operation annotation. Operations() map[gadgetv1alpha1.Operation]TraceOperation // OutputModesSupported returns the set of OutputMode supported by the // gadget. OutputModesSupported() map[gadgetv1alpha1.TraceOutputMode]struct{} }
type TraceFactoryWithDocumentation ¶
type TraceFactoryWithDocumentation interface {
Description() string
}
type TraceFactoryWithScheme ¶
type TraceFactoryWithScheme interface { TraceFactory // AddToScheme let gadgets inform the Trace controller of any scheme // they want to use AddToScheme(*apimachineryruntime.Scheme) }
type TraceOperation ¶
type TraceOperation struct { // Operation is the function called by the controller Operation func(name string, trace *gadgetv1alpha1.Trace) // Doc documents the operation. It is used to generate the // documentation. Doc string // Order controls the ordering of the operation in the documentation. // It's only needed when ordering alphabetically is not suitable. Order int }
TraceOperation packages an operation on a gadget that users can call via the annotation gadget.kinvolk.io/operation.
Click to show internal directories.
Click to hide internal directories.