plugins

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActuatorClientStub

type ActuatorClientStub struct {
	actuators.Actuator
	// contains filtered or unexported fields
}

ActuatorClientStub GRPC client stub to actuator plugins

func (*ActuatorClientStub) Effect

func (a *ActuatorClientStub) Effect(state *common.State, profiles map[string]common.Profile)

Effect triggers Effect RPC to plugin

func (*ActuatorClientStub) NextState

func (a *ActuatorClientStub) NextState(state *common.State, goal *common.State, profiles map[string]common.Profile) ([]common.State, []float64, []planner.Action)

NextState triggers NextState RPC to plugin

func (*ActuatorClientStub) Perform

func (a *ActuatorClientStub) Perform(state *common.State, plan []planner.Action)

Perform triggers Perform RPC to plugin

type ActuatorGrpcValidationSet

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

type ActuatorPluginStub

type ActuatorPluginStub struct {
	protobufs.UnimplementedActuatorPluginServer
	// contains filtered or unexported fields
}

ActuatorPluginStub Stub implementation for ActuatorPlugin. Plugins have to instantiate this stub and set specific function callbacks. An actuator needs to support nextState, perform and effect callbacks

func NewActuatorPluginStub

func NewActuatorPluginStub(name string, endpoint string, port int, serverEndpoint string, serverPort int) *ActuatorPluginStub

NewActuatorPluginStub creates a new actuator stub for a user defined plugin manager endpoint.

func (*ActuatorPluginStub) Effect

Effect grpc callback for the Effect function of pluggable Actuators

func (*ActuatorPluginStub) NextState

NextState grpc callback for the nextState function of pluggable Actuators

func (*ActuatorPluginStub) Perform

Perform grpc callback for the perform function of pluggable Actuators

func (*ActuatorPluginStub) Register

func (s *ActuatorPluginStub) Register() error

Register registers the actuator plugin for the given name with ido controller.

func (*ActuatorPluginStub) SetEffectFunc

func (s *ActuatorPluginStub) SetEffectFunc(f stubEffectFunc)

SetEffectFunc sets the Effect function callback

func (*ActuatorPluginStub) SetNextStateFunc

func (s *ActuatorPluginStub) SetNextStateFunc(f stubNextStateFunc)

SetNextStateFunc sets the NextState function callback

func (*ActuatorPluginStub) SetPerformFunc

func (s *ActuatorPluginStub) SetPerformFunc(f stubPerformFunc)

SetPerformFunc sets the Perform function callback

func (*ActuatorPluginStub) Start

func (s *ActuatorPluginStub) Start() error

Start starts the grpc server for the actuator plugin stub

func (*ActuatorPluginStub) Stop

func (s *ActuatorPluginStub) Stop() error

Stop stops the gRPC server. Can be called without a prior Start and more than once. Not safe to be called concurrently by different goroutines!

type ActuatorValidationSet

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

type ActuatorsPluginManager

type ActuatorsPluginManager interface {
	PluginManager
	// Iter thread-safe iterator over registered actuators
	Iter(f func(a actuators.Actuator))
}

ActuatorsPluginManager interface for actuator plugins

type PInfo

type PInfo struct {
	// Plugin name that uniquely identifies the plugin for the given plugin type.
	Name string
	// Mandatory endpoint location, it usually represents an internal ip to the pod
	// which will handle all plugin requests.
	Endpoint string
	// Plugin service API versions the plugin supports.
	Version string
}

PInfo plugin info struct

type PluginManager

type PluginManager interface {
	// Start starts the grpc server responsible for plugin registrations
	Start() error
	// Stop stops the grpc server responsible for plugin registrations
	Stop() error
	// contains filtered or unexported methods
}

PluginManager interface of an abstract plugin manager which can handle plugin registrations and de-registration

type PluginManagerServer

type PluginManagerServer struct {
	protobufs.UnimplementedRegistrationServer
	ActuatorsPluginManager
	// contains filtered or unexported fields
}

PluginManagerServer implements PluginManager GRPC Server protocol.

func NewPluginManagerServer

func NewPluginManagerServer(actuators []actuators.Actuator, endpoint string, port int) *PluginManagerServer

NewPluginManagerServer initializes new plugin manager server.

func (*PluginManagerServer) Iter

func (pm *PluginManagerServer) Iter(f func(a actuators.Actuator))

Iter a thread-safe iterator over registered actuators which can apply a functor f

func (*PluginManagerServer) Register

Register registration callback triggered when the server received a new register rpc call from a plugin

func (*PluginManagerServer) Start

func (pm *PluginManagerServer) Start() error

Start starts the grpc server for the actuator

func (*PluginManagerServer) Stop

func (pm *PluginManagerServer) Stop() error

Stop stops the plugin manager registration server and closes all outgoing plugin connections

type PluginMap

type PluginMap map[string]*ActuatorClientStub

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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