grpcruntime

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamNode              = "node"
	ParamRemoteAddress     = "remote-address"
	ParamConnectionMethod  = "connection-method"
	ParamConnectionTimeout = "connection-timeout"

	// ParamGadgetServiceTCPPort is only used in combination with KubernetesProxyConnectionMethodTCP
	ParamGadgetServiceTCPPort = "tcp-port"

	// ConnectTimeout is the time in seconds we wait for a connection to the remote to
	// succeed
	ConnectTimeout = 5

	// ResultTimeout is the time in seconds we wait for a result to return from the gadget
	// after sending a Stop command
	ResultTimeout = 30

	ParamGadgetNamespace   string = "gadget-namespace"
	DefaultGadgetNamespace string = "gadget"
)

Variables

This section is empty.

Functions

func NewK8SPortFwdConn added in v0.22.0

func NewK8SPortFwdConn(ctx context.Context, config *rest.Config, namespace string, pod target, targetPort uint16, timeout time.Duration) (net.Conn, error)

NewK8SPortFwdConn connects to a Pod using PortForwarding via the Kubernetes API Server

func WithConnectUsingK8SProxy added in v0.21.0

func WithConnectUsingK8SProxy(runtime *Runtime)

Types

type ConnectionMode added in v0.21.0

type ConnectionMode int
const (
	// ConnectionModeDirect will connect directly to the remote using the gRPC protocol; the remote side can either
	// be a tcp or a unix socket endpoint
	ConnectionModeDirect ConnectionMode = iota

	// ConnectionModeKubernetesProxy will connect to a gRPC endpoint through a kubernetes API server by first looking
	// up an appropriate target node using the kubernetes API, then using the port forward
	// endpoint of the Kubernetes API to forward the gRPC connection to the service listener (see gadgettracermgr).
	ConnectionModeKubernetesProxy
)

type Option added in v0.21.0

type Option func(runtime *Runtime)

type RunClient added in v0.21.0

type RunClient interface {
	Recv() (*api.GadgetEvent, error)
}

type Runtime

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

func New

func New(options ...Option) *Runtime

New instantiates the runtime and loads the locally stored gadget info. If no info is stored locally, it will try to fetch one from one of the gadget nodes and store it locally. It will issue warnings on failures.

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) GetCatalog

func (r *Runtime) GetCatalog() (*runtime.Catalog, error)

func (*Runtime) GetDefaultValue

func (r *Runtime) GetDefaultValue(key params.ValueHint) (string, bool)

func (*Runtime) GetGadgetInfo added in v0.22.0

func (r *Runtime) GetGadgetInfo(ctx context.Context, desc gadgets.GadgetDesc, gadgetParams *params.Params, args []string) (*runTypes.GadgetInfo, error)

func (*Runtime) GetOCIGadgetInfo added in v0.27.0

func (r *Runtime) GetOCIGadgetInfo(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, paramValues api.ParamValues) (*api.GadgetInfo, error)

func (*Runtime) GlobalParamDescs

func (r *Runtime) GlobalParamDescs() params.ParamDescs

func (*Runtime) Init

func (r *Runtime) Init(runtimeGlobalParams *params.Params) error

func (*Runtime) InitDeployInfo added in v0.21.0

func (r *Runtime) InitDeployInfo()

InitDeployInfo loads the locally stored deploy info. If no deploy info is stored locally, it will try to fetch it from one of the remotes and store it locally. It will issue warnings on failures.

func (*Runtime) ParamDescs

func (r *Runtime) ParamDescs() params.ParamDescs

func (*Runtime) RunGadget

func (r *Runtime) RunGadget(gadgetCtx runtime.GadgetContext) (runtime.CombinedGadgetResult, error)

func (*Runtime) RunOCIGadget added in v0.27.0

func (r *Runtime) RunOCIGadget(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, paramValues api.ParamValues) error

func (*Runtime) SetDefaultValue

func (r *Runtime) SetDefaultValue(key params.ValueHint, value string)

func (*Runtime) SetRestConfig added in v0.23.0

func (r *Runtime) SetRestConfig(config *rest.Config)

func (*Runtime) UpdateDeployInfo added in v0.18.0

func (r *Runtime) UpdateDeployInfo() error

Jump to

Keyboard shortcuts

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