manager

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginInstance

type PluginInstance interface {

	// Kill kills the plugin if it is external. It is safe to call on internal
	// plugins.
	Kill()

	// Plugin returns the wrapped plugin instance.
	Plugin() interface{}
}

PluginInstance is a wrapper of a plugin and provides a common interface whether the plugin is internal or running externally via a binary.

type PluginManager

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

PluginManager is the brains of the plugin operation and should be used to manage plugin lifecycle as well as provide access to the underlying plugin interfaces.

func NewPluginManager

func NewPluginManager(log hclog.Logger, dir string, cfg map[string][]*config.Plugin) *PluginManager

NewPluginManager sets up a new PluginManager for use.

func (*PluginManager) Dispense

func (pm *PluginManager) Dispense(name, pluginType string) (PluginInstance, error)

Dispense returns a PluginInstance for use by safely obtaining the PluginInstance from storage if we have it.

func (*PluginManager) GetAPM added in v0.4.0

func (pm *PluginManager) GetAPM(source string) (apm.APM, error)

func (*PluginManager) GetStrategy added in v0.4.0

func (pm *PluginManager) GetStrategy(name string) (strategy.Strategy, error)

func (*PluginManager) GetTarget added in v0.4.0

func (pm *PluginManager) GetTarget(target *sdk.ScalingPolicyTarget) (targetpkg.Target, error)

func (*PluginManager) KillPlugins

func (pm *PluginManager) KillPlugins()

KillPlugins calls Kill on all plugins currently dispensed.

func (*PluginManager) Load

func (pm *PluginManager) Load() error

Load is responsible for registering and executing the plugins configured for use by the Autoscaler agent.

func (*PluginManager) Reload added in v0.3.0

func (pm *PluginManager) Reload(newCfg map[string][]*config.Plugin) error

Jump to

Keyboard shortcuts

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