base

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MPL-2.0 Imports: 6 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v0.3.0

type Base interface {

	// PluginInfo returns information regarding the plugin. This is used during
	// the plugin's setup as well as lifecycle. Any error generated during the
	// plugin's internal process to create and return this information should be
	// sent back to the caller so it can be presented.
	PluginInfo() (*PluginInfo, error)

	// SetConfig is used by the Autoscaler core to set plugin-specific
	// configuration on the remote target. If this call fails, the plugin
	// should be considered in a terminal state.
	SetConfig(config map[string]string) error
}

Base is the common interface that all Autoscaler plugins should implement. It defines basic functionality which helps the Autoscaler core deal with plugins in a common manner.

type PluginBase added in v0.3.0

type PluginBase struct {

	// Embedded so we disable support for net/rpc based plugins.
	plugin.NetRPCUnsupportedPlugin

	// Impl is the Base interface implementation that the plugin serves.
	Impl Base
}

PluginBase is the Base implementation of the go-plugin GRPCPlugin interface.

func (*PluginBase) GRPCClient added in v0.3.0

func (p *PluginBase) GRPCClient(ctx context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient is the Base implementation of the go-plugin GRPCPlugin.GRPCClient interface function.

func (*PluginBase) GRPCServer added in v0.3.0

func (p *PluginBase) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer is the Base implementation of the go-plugin GRPCPlugin.GRPCServer interface function.

type PluginClient added in v0.3.0

type PluginClient struct {
	Client  proto.BasePluginServiceClient
	DoneCtx context.Context
}

PluginClient is the gRPC client implementation of the APM interface. It is the only exported plugin client as it is consumed and utilised by all other plugins.

func (*PluginClient) PluginInfo added in v0.3.0

func (p *PluginClient) PluginInfo() (*PluginInfo, error)

PluginInfo is the gRPC client implementation of the Base.PluginInfo interface function.

func (*PluginClient) SetConfig added in v0.3.0

func (p *PluginClient) SetConfig(cfg map[string]string) error

SetConfig is the gRPC client implementation of the Base.SetConfig interface function.

type PluginInfo

type PluginInfo struct {
	Name       string
	PluginType string
}

PluginInfo is the information used by plugins to identify themselves and contains critical information about their configuration. It is used within the base plugin PluginInfo response RPC call.

TODO (jrasell) think about moving this into the SDK.

Directories

Path Synopsis
proto
v1

Jump to

Keyboard shortcuts

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