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
type RuntimeManager ¶
type RuntimeManager interface {
RunGadget(gadgetCtx *gadgetcontext.GadgetContext, params map[string]string) error
}
RuntimeManager defines the interface for running gadgets
Click to show internal directories.
Click to hide internal directories.