Documentation
¶
Index ¶
Constants ¶
View Source
const (
// NumRunTargets is the number of targets that the gadget will run on
NumRunTargets = "n-run-targets"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶ added in v0.15.0
type Catalog struct { Gadgets []*GadgetInfo Operators []*OperatorInfo }
Catalog stores both data about gadgets and operators in a serializable way. This is used to handle gadgets and operators, even if they aren't run locally (and their code is not or only partially available)
type CombinedGadgetResult ¶ added in v0.15.0
type CombinedGadgetResult map[string]*GadgetResult
func (CombinedGadgetResult) Err ¶ added in v0.15.0
func (r CombinedGadgetResult) Err() error
type GadgetContext ¶
type GadgetContext interface { ID() string Parser() parser.Parser GadgetDesc() gadgets.GadgetDesc Context() context.Context Operators() operators.Operators Logger() logger.Logger RuntimeParams() *params.Params GadgetParams() *params.Params Args() []string OperatorsParamCollection() params.Collection Timeout() time.Duration UseInstance() bool Cancel() ImageName() string RegisterDataSource(datasource.Type, string) (datasource.DataSource, error) GetDataSources() map[string]datasource.DataSource GetAllDataSources() map[string]datasource.DataSource SetVar(string, any) GetVar(string) (any, bool) SerializeGadgetInfo() (*api.GadgetInfo, error) LoadGadgetInfo(info *api.GadgetInfo, paramValues api.ParamValues, run bool) error Params() []*api.Param SetMetadata([]byte) SetParams([]*api.Param) DataOperators() []operators.DataOperator OrasTarget() oras.ReadOnlyTarget IsRemoteCall() bool Run(paramValues api.ParamValues) error PrepareGadgetInfo(paramValues api.ParamValues) error }
type GadgetInfo ¶ added in v0.15.0
type GadgetInfo struct { ID string `json:"id"` Name string `json:"name"` Category string `json:"category"` Type string `json:"type"` Description string `json:"description"` Params params.ParamDescs `json:"params"` ColumnsDefinition any `json:"columnsDefinition"` OperatorParamsCollection params.DescCollection `json:"operatorParamsCollection"` }
GadgetInfo is used to store GadgetDesc information in a serializable way
func GadgetInfoFromGadgetDesc ¶ added in v0.15.0
func GadgetInfoFromGadgetDesc(gadgetDesc gadgets.GadgetDesc) *GadgetInfo
type GadgetResult ¶ added in v0.15.0
GadgetResult contains the (optional) payload and error of a gadget run for a node
type OperatorInfo ¶ added in v0.15.0
OperatorInfo is used to store operator information in a serializable way
func OperatorToOperatorInfo ¶ added in v0.15.0
func OperatorToOperatorInfo(operator operators.Operator) *OperatorInfo
type Runtime ¶
type Runtime interface { Init(globalRuntimeParams *params.Params) error Close() error GlobalParamDescs() params.ParamDescs ParamDescs() params.ParamDescs // GetGadgetInfo returns information about the gadget and used operators; this info potentially comes // from a cache GetGadgetInfo(gadgetCtx GadgetContext, runtimeParams *params.Params, paramValueMap api.ParamValues) (*api.GadgetInfo, error) RunBuiltInGadget(gadgetCtx GadgetContext) (CombinedGadgetResult, error) RunGadget(gadgetCtx GadgetContext, runtimeParams *params.Params, paramValueMap api.ParamValues) error GetCatalog() (*Catalog, error) SetDefaultValue(params.ValueHint, string) GetDefaultValue(params.ValueHint) (string, bool) }
Runtime is the interface for gadget runtimes. Runtimes are used to control the lifecycle of gadgets either locally or remotely.
Click to show internal directories.
Click to hide internal directories.