plugins

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientScheme = meta.NewScheme()
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  plugin.CoreProtocolVersion,
	MagicCookieKey:   "OPNI_MONITORING_MAGIC_COOKIE",
	MagicCookieValue: "opni-monitoring",
}

Functions

func CheckAvailability

func CheckAvailability(ctx context.Context, cc *grpc.ClientConn, id string) error

func ClientConfig

func ClientConfig(md meta.PluginMeta, scheme meta.Scheme, reattach ...*plugin.ReattachConfig) *plugin.ClientConfig

func ConfigureSysProcAttr

func ConfigureSysProcAttr(cmd *exec.Cmd)

func Serve

func Serve(scheme meta.Scheme)

func ServeConfig

func ServeConfig(scheme meta.Scheme) *plugin.ServeConfig

Types

type ActivePlugin

type ActivePlugin struct {
	Metadata   meta.PluginMeta
	GRPCClient *grpc.ClientConn
	RPCClient  *plugin.RPCClient
	Raw        interface{}
}

type PluginLoader

type PluginLoader struct {
	ActivePlugins map[string][]ActivePlugin
	Logger        *zap.SugaredLogger
}

func NewPluginLoader

func NewPluginLoader() *PluginLoader

func (*PluginLoader) DispenseAll

func (pl *PluginLoader) DispenseAll(id string) []ActivePlugin

func (*PluginLoader) Load

func (pl *PluginLoader) Load(md meta.PluginMeta, cc *plugin.ClientConfig)

type TypedActivePlugin

type TypedActivePlugin[T any] struct {
	Metadata meta.PluginMeta
	Client   *grpc.ClientConn
	Typed    T
}

func DispenseAllAs

func DispenseAllAs[T any](pl *PluginLoader, id string) []TypedActivePlugin[T]

Directories

Path Synopsis
apis

Jump to

Keyboard shortcuts

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