plugins

package
v0.6.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPluginGlob = "plugin_*"

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  plugin.CoreProtocolVersion,
	MagicCookieKey:   "OPNI_MAGIC_COOKIE",
	MagicCookieValue: "opni",
}
View Source
var NoopLoader = noopLoader{}

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 LoaderInterface added in v0.5.4

type LoaderInterface interface {
	// Adds a hook to the loader, which will be invoked at a specific time according
	// to the hook type. See the specific hooks for more information.
	Hook(h any)
}

type PluginLoader

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

func NewPluginLoader

func NewPluginLoader() *PluginLoader

func (*PluginLoader) Complete added in v0.5.4

func (p *PluginLoader) Complete()

Complete marks the plugin loader as completed. This function will be called automatically by LoadPlugins(), although it can be called manually if LoadPlugins() is not used. It is not safe to call this function and LoadPlugins() on the same plugin loader. It will invoke LoadingCompletedHooks in parallel and does not block.

func (*PluginLoader) Hook added in v0.5.4

func (p *PluginLoader) Hook(h any)

func (*PluginLoader) LoadOne added in v0.5.4

func (p *PluginLoader) LoadOne(ctx context.Context, md meta.PluginMeta, cc *plugin.ClientConfig)

LoadOne loads a single plugin. It invokes PluginLoadHooks for the type of the plugin being loaded and will block until all load hooks have completed.

func (*PluginLoader) LoadPlugins added in v0.5.4

func (p *PluginLoader) LoadPlugins(ctx context.Context, conf v1beta1.PluginsSpec, scheme meta.Scheme, reattach ...*plugin.ReattachConfig)

LoadPlugins loads a set of plugins defined by the plugin configuration. This function loads plugins in parallel and does not block. It will invoke LoadingCompletedHooks once all plugins have been loaded. Once this function is called, it is unsafe to call LoadPlugins() or LoadOne() again for this plugin loader, although new hooks can still be added and will be invoked immediately according to the current state of the plugin loader.

Directories

Path Synopsis
Package apis can be imported to ensure all plugin APIs are added to client schemes.
Package apis can be imported to ensure all plugin APIs are added to client schemes.
Package hooks contains interfaces used to invoke callbacks at specific points during the plugin loading process.
Package hooks contains interfaces used to invoke callbacks at specific points during the plugin loading process.

Jump to

Keyboard shortcuts

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