plugins

package
v0.0.1-techpreview2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MPL-2.0 Imports: 6 Imported by: 27

Documentation

Index

Constants

View Source
const (
	// PluginTypeAPM is a plugin which satisfies the APM interface.
	PluginTypeAPM = "apm"

	// PluginTypeTarget is a plugin which satisfies the Target interface.
	PluginTypeTarget = "target"

	// PluginTypeStrategy is a plugin which satisfies the Strategy interface.
	PluginTypeStrategy = "strategy"
)
View Source
const (

	// InternalAPMNomad is the Nomad APM internal plugin name.
	InternalAPMNomad = "nomad-apm"

	// InternalTargetNomad is the Nomad Target internal plugin name.
	InternalTargetNomad = "nomad-target"

	// InternalAPMPrometheus is the Prometheus APM internal plugin name.
	InternalAPMPrometheus = "prometheus"

	// InternalStrategyTargetValue is the Target Value Strategy internal plugin
	// name.
	InternalStrategyTargetValue = "target-value"
)

Variables

View Source
var (
	// Handshake is used to do a basic handshake between a plugin and host. If
	// the handshake fails, a user friendly error is shown. This prevents users
	// from executing bad plugins or executing a plugin directory. It is a UX
	// feature, not a security feature.
	//
	// Currently the Nomad Autoscaler plugin visioning is performed using the
	// ProtocolVersion within the Handshake.
	Handshake = plugin.HandshakeConfig{
		ProtocolVersion:  1,
		MagicCookieKey:   "NOMAD_AUTOSCALER_PLUGIN_MAGIC_COOKIE",
		MagicCookieValue: "e082fa04d587a6525d683666fa253d6afda00f20c122c54a80a3ed57fec99ff3",
	}
)

Functions

func Serve

func Serve(f PluginFactory)

Serve is used to serve a Nomad Autoscaler Plugin.

Types

type InternalPluginConfig

type InternalPluginConfig struct{ Factory PluginFactory }

InternalPluginConfig is a struct that internal plugins must implement in order to provide critical information about the plugin and launching it.

type PluginFactory

type PluginFactory func(log hclog.Logger) interface{}

PluginFactory is used to return a new plugin instance.

type PluginID

type PluginID struct {
	Name       string
	PluginType string
}

PluginID contains plugin metadata and identifies a plugin. It is used as a key to aid plugin lookups. The information held here is also reflected within PluginInfo, but will not include all.

func (PluginID) String

func (p PluginID) String() string

String returns a human readable version of PluginID.

Jump to

Keyboard shortcuts

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