plugin

package
v0.0.0-...-dcdb2a0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{

	MagicCookieKey:   "WAYPOINT_PLUGIN",
	MagicCookieValue: "be6c1928786a4df0222c13eef44ac846da2c0d461d99addc93f804601c6b7205",
}

Handshake is a common handshake that is shared by plugin and host.

Functions

func Plugins

func Plugins(opts ...Option) map[int]plugin.PluginSet

Plugins returns the list of available plugins and initializes them with the given components. This will panic if an invalid component is given.

Types

type BuilderPlugin

type BuilderPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.Builder // Impl is the concrete implementation
	Mappers []*argmapper.Func // Mappers
	Logger  hclog.Logger      // Logger

	ODR *ODRSetting // Used to switch builder modes based on ondemand-runner in play
}

BuilderPlugin implements plugin.Plugin (specifically GRPCPlugin) for the Builder component type.

func (*BuilderPlugin) GRPCClient

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

func (*BuilderPlugin) GRPCServer

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

type ConfigSourcerPlugin

type ConfigSourcerPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.ConfigSourcer // Impl is the concrete implementation
	Mappers []*argmapper.Func       // Mappers
	Logger  hclog.Logger            // Logger
}

ConfigSourcerPlugin implements plugin.Plugin (specifically GRPCPlugin) for the ConfigSourcer component type.

func (*ConfigSourcerPlugin) GRPCClient

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

func (*ConfigSourcerPlugin) GRPCServer

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

type MapperClient

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

MapperClient is an implementation of component.Mapper over gRPC.

func (*MapperClient) Mappers

func (c *MapperClient) Mappers() ([]*argmapper.Func, error)

Mappers returns the list of mappers that are supported by this plugin.

type MapperPlugin

type MapperPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Mappers []*argmapper.Func // Mappers
	Logger  hclog.Logger      // Logger
}

MapperPlugin implements plugin.Plugin (specifically GRPCPlugin) for the Mapper plugin type.

func (*MapperPlugin) GRPCClient

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

func (*MapperPlugin) GRPCServer

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

type ODRSetting

type ODRSetting struct {
	Enabled bool
}

ODRSetting are any specific settings associated with running a plugin in Ondemand Runner (aka ODR) mode.

type Option

type Option func(*pluginConfig)

Option configures Plugins

func WithComponents

func WithComponents(cs ...interface{}) Option

WithComponents sets the components to configure for the plugins. This will append to the components.

func WithLogger

func WithLogger(log hclog.Logger) Option

WithLogger sets the logger for the plugins.

func WithMappers

func WithMappers(ms ...*argmapper.Func) Option

WithMappers sets the mappers to configure for the plugins. This will append to the existing mappers.

func WithODR

func WithODR(odr *ODRSetting) Option

WithODR sets the ODRSettings for the plugins that are created.

type PlatformPlugin

type PlatformPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.Platform // Impl is the concrete implementation
	Mappers []*argmapper.Func  // Mappers
	Logger  hclog.Logger       // Logger
}

PlatformPlugin implements plugin.Plugin (specifically GRPCPlugin) for the Platform component type.

func (*PlatformPlugin) GRPCClient

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

func (*PlatformPlugin) GRPCServer

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

type RegistryPlugin

type RegistryPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.Registry // Impl is the concrete implementation
	Mappers []*argmapper.Func  // Mappers
	Logger  hclog.Logger       // Logger
}

RegistryPlugin implements plugin.Plugin (specifically GRPCPlugin) for the Registry component type.

func (*RegistryPlugin) GRPCClient

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

func (*RegistryPlugin) GRPCServer

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

type ReleaseManagerPlugin

type ReleaseManagerPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.ReleaseManager // Impl is the concrete implementation
	Mappers []*argmapper.Func        // Mappers
	Logger  hclog.Logger             // Logger
}

ReleaseManagerPlugin implements plugin.Plugin (specifically GRPCPlugin) for the ReleaseManager component type.

func (*ReleaseManagerPlugin) GRPCClient

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

func (*ReleaseManagerPlugin) GRPCServer

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

type TaskLauncherPlugin

type TaskLauncherPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl    component.TaskLauncher // Impl is the concrete implementation
	Mappers []*argmapper.Func      // Mappers
	Logger  hclog.Logger           // Logger
}

TaskLauncherPlugin implements plugin.Plugin (specifically GRPCPlugin) for the TaskLauncher component type.

func (*TaskLauncherPlugin) GRPCClient

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

func (*TaskLauncherPlugin) GRPCServer

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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