gadget

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextManager

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

ContextManager handles the creation and management of gadget contexts

func NewContextManager

func NewContextManager(operators []operators.DataOperator) *ContextManager

NewContextManager creates a new ContextManager with the given operators

func (*ContextManager) CreateContext

func (cm *ContextManager) CreateContext(ctx context.Context, gadgetBytes []byte, gadgetImage string) (*gadgetcontext.GadgetContext, error)

CreateContext creates a new gadget context with the given configuration

type GadgetConfig

type GadgetConfig struct {
	Bytes     []byte
	ImageName string
	Params    map[string]string
	Context   GadgetContextCreator // Optional context manager override
}

GadgetConfig holds the configuration for a single gadget

type GadgetContextCreator

type GadgetContextCreator interface {
	CreateContext(ctx context.Context, gadgetBytes []byte, gadgetImage string) (*gadgetcontext.GadgetContext, error)
}

GadgetContextCreator defines the interface for creating gadget contexts

type Registry

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

Registry manages multiple gadgets and their execution

func NewRegistry

func NewRegistry(defaultContextManager GadgetContextCreator, runtimeManager RuntimeManager) *Registry

NewRegistry creates a new gadget registry

func (*Registry) Register

func (r *Registry) Register(name string, config *GadgetConfig)

Register adds a new gadget to the registry

func (*Registry) RunAll

func (r *Registry) RunAll(ctx context.Context) error

RunAll starts all registered gadgets

type RuntimeManager

type RuntimeManager interface {
	RunGadget(gadgetCtx *gadgetcontext.GadgetContext, params map[string]string) error
}

RuntimeManager defines the interface for running gadgets

Jump to

Keyboard shortcuts

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