Documentation ¶
Index ¶
- type ActuatorClientStub
- func (a *ActuatorClientStub) Effect(state *common.State, profiles map[string]common.Profile)
- func (a *ActuatorClientStub) NextState(state *common.State, goal *common.State, profiles map[string]common.Profile) ([]common.State, []float64, []planner.Action)
- func (a *ActuatorClientStub) Perform(state *common.State, plan []planner.Action)
- type ActuatorGrpcValidationSet
- type ActuatorPluginStub
- func (s *ActuatorPluginStub) Effect(_ context.Context, r *protobufs.EffectRequest) (*protobufs.Empty, error)
- func (s *ActuatorPluginStub) NextState(stream protobufs.ActuatorPlugin_NextStateServer) error
- func (s *ActuatorPluginStub) Perform(_ context.Context, r *protobufs.PerformRequest) (*protobufs.Empty, error)
- func (s *ActuatorPluginStub) Register() error
- func (s *ActuatorPluginStub) SetEffectFunc(f stubEffectFunc)
- func (s *ActuatorPluginStub) SetNextStateFunc(f stubNextStateFunc)
- func (s *ActuatorPluginStub) SetPerformFunc(f stubPerformFunc)
- func (s *ActuatorPluginStub) Start() error
- func (s *ActuatorPluginStub) Stop() error
- type ActuatorValidationSet
- type ActuatorsPluginManager
- type PInfo
- type PluginManager
- type PluginManagerServer
- type PluginMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActuatorClientStub ¶
ActuatorClientStub GRPC client stub to actuator plugins
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 ¶
func (s *ActuatorPluginStub) Effect(_ context.Context, r *protobufs.EffectRequest) (*protobufs.Empty, error)
Effect grpc callback for the Effect function of pluggable Actuators
func (*ActuatorPluginStub) NextState ¶
func (s *ActuatorPluginStub) NextState(stream protobufs.ActuatorPlugin_NextStateServer) error
NextState grpc callback for the nextState function of pluggable Actuators
func (*ActuatorPluginStub) Perform ¶
func (s *ActuatorPluginStub) Perform(_ context.Context, r *protobufs.PerformRequest) (*protobufs.Empty, error)
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 ¶
func (pm *PluginManagerServer) Register(_ context.Context, r *protobufs.RegisterRequest) (*protobufs.RegistrationStatusResponse, error)
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