Documentation
¶
Overview ¶
Package gadgetcontext handles initializing gadgets and installed operators before handing them over to a specified runtime.
Index ¶
- func WaitForTimeoutOrDone(c gadgets.GadgetContext)
- func WithTimeoutOrCancel(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- type GadgetContext
- func (c *GadgetContext) Args() []string
- func (c *GadgetContext) Cancel()
- func (c *GadgetContext) Context() context.Context
- func (c *GadgetContext) DataOperators() []operators.DataOperator
- func (c *GadgetContext) GadgetDesc() gadgets.GadgetDesc
- func (c *GadgetContext) GadgetParams() *params.Params
- func (c *GadgetContext) GetAllDataSources() map[string]datasource.DataSource
- func (c *GadgetContext) GetDataSources() map[string]datasource.DataSource
- func (c *GadgetContext) GetVar(varName string) (any, bool)
- func (c *GadgetContext) GetVars() map[string]any
- func (c *GadgetContext) ID() string
- func (c *GadgetContext) ImageName() string
- func (c *GadgetContext) IsRemoteCall() bool
- func (c *GadgetContext) LoadGadgetInfo(info *api.GadgetInfo, paramValues api.ParamValues, run bool) error
- func (c *GadgetContext) Logger() logger.Logger
- func (c *GadgetContext) Operators() operators.Operators
- func (c *GadgetContext) OperatorsParamCollection() params.Collection
- func (c *GadgetContext) OrasTarget() oras.ReadOnlyTarget
- func (c *GadgetContext) Params() []*api.Param
- func (c *GadgetContext) Parser() parser.Parser
- func (c *GadgetContext) PrepareGadgetInfo(paramValues api.ParamValues) error
- func (c *GadgetContext) RegisterDataSource(t datasource.Type, name string) (datasource.DataSource, error)
- func (c *GadgetContext) Run(paramValues api.ParamValues) error
- func (c *GadgetContext) Runtime() runtime.Runtime
- func (c *GadgetContext) RuntimeParams() *params.Params
- func (c *GadgetContext) SerializeGadgetInfo() (*api.GadgetInfo, error)
- func (c *GadgetContext) SetMetadata(m []byte)
- func (c *GadgetContext) SetParams(params []*api.Param)
- func (c *GadgetContext) SetVar(varName string, value any)
- func (c *GadgetContext) Timeout() time.Duration
- func (c *GadgetContext) UseInstance() bool
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitForTimeoutOrDone ¶ added in v0.15.0
func WaitForTimeoutOrDone(c gadgets.GadgetContext)
func WithTimeoutOrCancel ¶ added in v0.15.0
Types ¶
type GadgetContext ¶
type GadgetContext struct {
// contains filtered or unexported fields
}
GadgetContext handles running gadgets by the gadget interface; it orchestrates the whole lifecycle of the gadget instance and communicates with gadget and runtime.
func NewBuiltIn ¶ added in v0.28.0
func NewBuiltIn( ctx context.Context, id string, runtime runtime.Runtime, runtimeParams *params.Params, gadget gadgets.GadgetDesc, gadgetParams *params.Params, args []string, operatorsParamCollection params.Collection, parser parser.Parser, logger logger.Logger, timeout time.Duration, ) *GadgetContext
func (*GadgetContext) Args ¶ added in v0.18.0
func (c *GadgetContext) Args() []string
func (*GadgetContext) Cancel ¶ added in v0.15.0
func (c *GadgetContext) Cancel()
func (*GadgetContext) Context ¶
func (c *GadgetContext) Context() context.Context
func (*GadgetContext) DataOperators ¶ added in v0.27.0
func (c *GadgetContext) DataOperators() []operators.DataOperator
func (*GadgetContext) GadgetDesc ¶
func (c *GadgetContext) GadgetDesc() gadgets.GadgetDesc
func (*GadgetContext) GadgetParams ¶
func (c *GadgetContext) GadgetParams() *params.Params
func (*GadgetContext) GetAllDataSources ¶ added in v0.31.0
func (c *GadgetContext) GetAllDataSources() map[string]datasource.DataSource
func (*GadgetContext) GetDataSources ¶ added in v0.27.0
func (c *GadgetContext) GetDataSources() map[string]datasource.DataSource
func (*GadgetContext) GetVar ¶ added in v0.27.0
func (c *GadgetContext) GetVar(varName string) (any, bool)
func (*GadgetContext) GetVars ¶ added in v0.27.0
func (c *GadgetContext) GetVars() map[string]any
func (*GadgetContext) ID ¶
func (c *GadgetContext) ID() string
func (*GadgetContext) ImageName ¶ added in v0.27.0
func (c *GadgetContext) ImageName() string
func (*GadgetContext) IsRemoteCall ¶ added in v0.31.0
func (c *GadgetContext) IsRemoteCall() bool
func (*GadgetContext) LoadGadgetInfo ¶ added in v0.27.0
func (c *GadgetContext) LoadGadgetInfo(info *api.GadgetInfo, paramValues api.ParamValues, run bool) error
func (*GadgetContext) Logger ¶
func (c *GadgetContext) Logger() logger.Logger
func (*GadgetContext) Operators ¶
func (c *GadgetContext) Operators() operators.Operators
func (*GadgetContext) OperatorsParamCollection ¶
func (c *GadgetContext) OperatorsParamCollection() params.Collection
func (*GadgetContext) OrasTarget ¶ added in v0.29.0
func (c *GadgetContext) OrasTarget() oras.ReadOnlyTarget
func (*GadgetContext) Params ¶ added in v0.27.0
func (c *GadgetContext) Params() []*api.Param
func (*GadgetContext) Parser ¶
func (c *GadgetContext) Parser() parser.Parser
func (*GadgetContext) PrepareGadgetInfo ¶ added in v0.27.0
func (c *GadgetContext) PrepareGadgetInfo(paramValues api.ParamValues) error
func (*GadgetContext) RegisterDataSource ¶ added in v0.27.0
func (c *GadgetContext) RegisterDataSource(t datasource.Type, name string) (datasource.DataSource, error)
func (*GadgetContext) Run ¶ added in v0.27.0
func (c *GadgetContext) Run(paramValues api.ParamValues) error
func (*GadgetContext) Runtime ¶
func (c *GadgetContext) Runtime() runtime.Runtime
func (*GadgetContext) RuntimeParams ¶ added in v0.15.0
func (c *GadgetContext) RuntimeParams() *params.Params
func (*GadgetContext) SerializeGadgetInfo ¶ added in v0.27.0
func (c *GadgetContext) SerializeGadgetInfo() (*api.GadgetInfo, error)
func (*GadgetContext) SetMetadata ¶ added in v0.27.0
func (c *GadgetContext) SetMetadata(m []byte)
func (*GadgetContext) SetParams ¶ added in v0.27.0
func (c *GadgetContext) SetParams(params []*api.Param)
func (*GadgetContext) SetVar ¶ added in v0.27.0
func (c *GadgetContext) SetVar(varName string, value any)
func (*GadgetContext) Timeout ¶ added in v0.15.0
func (c *GadgetContext) Timeout() time.Duration
func (*GadgetContext) UseInstance ¶ added in v0.33.0
func (c *GadgetContext) UseInstance() bool
type Option ¶ added in v0.27.0
type Option func(gadgetCtx *GadgetContext)
func WithAsRemoteCall ¶ added in v0.31.0
func WithDataOperators ¶ added in v0.27.0
func WithDataOperators(ops ...operators.DataOperator) Option
func WithLogger ¶ added in v0.27.0
func WithOrasReadonlyTarget ¶ added in v0.29.0
func WithOrasReadonlyTarget(ociStore oras.ReadOnlyTarget) Option
func WithTimeout ¶ added in v0.28.0
func WithUseInstance ¶ added in v0.33.0
Click to show internal directories.
Click to hide internal directories.