Documentation ¶
Index ¶
- Constants
- Variables
- type Controller
- type ControllerBase
- type ControllerGRPCClient
- type ControllerGRPCServer
- func (s *ControllerGRPCServer) Command(req *proto.Frame, stream proto.Controller_CommandServer) error
- func (s *ControllerGRPCServer) GetVersion(ctx context.Context, _ *proto.Empty) (*proto.VersionNumber, error)
- func (s *ControllerGRPCServer) PushVersion(ctx context.Context, req *proto.VersionNumber) (*proto.Empty, error)
- func (s *ControllerGRPCServer) Stop(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- type ControllerPlugin
- type Datasource
- type DatasourceBase
- type DatasourceGRPCClient
- type DatasourceGRPCServer
- func (s *DatasourceGRPCServer) GetVersion(ctx context.Context, _ *proto.Empty) (*proto.VersionNumber, error)
- func (s *DatasourceGRPCServer) PushVersion(ctx context.Context, req *proto.VersionNumber) (*proto.Empty, error)
- func (s *DatasourceGRPCServer) StartRecord(_ *proto.Empty, stream proto.Datasource_StartRecordServer) error
- func (s *DatasourceGRPCServer) Stop(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *DatasourceGRPCServer) StopRecord(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- type DatasourcePlugin
Constants ¶
const ( ErrPluginVersionNotSet = bg.Error("plugin version not set") ErrLaniakeaVersionMismatch = bg.Error("plugin requires a different version of laniakea") )
Variables ¶
var (
HandshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "LANIAKEA_PLUGIN_MAGIC_COOKIE",
MagicCookieValue: "a56e5daaa516e17d3d4b3d4685df9f8ca59c62c2d818cd5a7df13c039f134e16",
}
)
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { Stop() error Command(*proto.Frame) (chan *proto.Frame, error) PushVersion(versionNumber string) error // This method pushes the version of Laniakea to the plugin. Plugin can then specify a minimum version of laniakea to run properly GetVersion() (string, error) // This method gets the version number from the plugin. Needed if plugins rely on other plugins and specific versions are needed }
Controller interface describes an interface for plugins which produce data but also act as controllers
type ControllerBase ¶
type ControllerBase struct {
// contains filtered or unexported fields
}
ControllerBase is a rough implementation of the Controller interface It implements the PushVersion and GetVersion functions for convenience
func (*ControllerBase) GetLaniVersion ¶
func (b *ControllerBase) GetLaniVersion() string
GetLaniVersion returns the version of laniakea
func (*ControllerBase) GetVersion ¶
func (b *ControllerBase) GetVersion() (string, error)
GetVersion returns the current plugin version if it has been set
func (*ControllerBase) PushVersion ¶
func (b *ControllerBase) PushVersion(versionNumber string) error
PushVersion sets the required laniakea version
func (*ControllerBase) SetPluginVersion ¶
func (b *ControllerBase) SetPluginVersion(verStr string)
SetPluginVersion sets the plugin version string
func (*ControllerBase) SetVersionConstraints ¶
func (b *ControllerBase) SetVersionConstraints(verStr string) error
SetVersionConstraints sets the version constraints on Laniakea
type ControllerGRPCClient ¶
type ControllerGRPCClient struct {
// contains filtered or unexported fields
}
func (*ControllerGRPCClient) GetVersion ¶
func (c *ControllerGRPCClient) GetVersion() (string, error)
GetVersion implements the Controller interface method GetVersion
func (*ControllerGRPCClient) PushVersion ¶
func (c *ControllerGRPCClient) PushVersion(versionNumber string) error
PushVersion implements the Controller interface method PushVersion
func (*ControllerGRPCClient) Stop ¶
func (c *ControllerGRPCClient) Stop() error
Stop implements the Controller interface method Stop
type ControllerGRPCServer ¶
type ControllerGRPCServer struct { proto.UnimplementedControllerServer Impl Controller }
func (*ControllerGRPCServer) Command ¶
func (s *ControllerGRPCServer) Command(req *proto.Frame, stream proto.Controller_CommandServer) error
Command implements the Controller gRPC server interface
func (*ControllerGRPCServer) GetVersion ¶
func (s *ControllerGRPCServer) GetVersion(ctx context.Context, _ *proto.Empty) (*proto.VersionNumber, error)
GetVersion implements the Controller gRPC server interface
func (*ControllerGRPCServer) PushVersion ¶
func (s *ControllerGRPCServer) PushVersion(ctx context.Context, req *proto.VersionNumber) (*proto.Empty, error)
PushVersion implements the Controller gRPC server interface
type ControllerPlugin ¶
type ControllerPlugin struct { plugin.Plugin Impl Controller }
func (*ControllerPlugin) GRPCClient ¶
func (p *ControllerPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient implements the plugin.Plugin interface in the go-plugin package
func (*ControllerPlugin) GRPCServer ¶
func (p *ControllerPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer implements the plugin.Plugin interface in the go-plugin package
type Datasource ¶
type Datasource interface { StartRecord() (chan *proto.Frame, error) StopRecord() error Stop() error PushVersion(versionNumber string) error // This method pushes the version of Laniakea to the plugin. Plugin can then specify a minimum version of laniakea to run properly GetVersion() (string, error) // This method gets the version number from the plugin. Needed if plugins rely on other plugins and specific versions are needed }
Datasource interface describes an interface for plugins which will only produce streams of data
type DatasourceBase ¶
type DatasourceBase struct {
// contains filtered or unexported fields
}
DatasourceBase is a rough implementation of the Datasource interface It implements the PushVersion and GetVersion functions for convenience
func (*DatasourceBase) GetLaniVersion ¶
func (b *DatasourceBase) GetLaniVersion() string
GetLaniVersion returns the version of laniakea
func (*DatasourceBase) GetVersion ¶
func (b *DatasourceBase) GetVersion() (string, error)
GetVersion returns the current plugin version if it has been set
func (*DatasourceBase) PushVersion ¶
func (b *DatasourceBase) PushVersion(versionNumber string) error
PushVersion sets the laniakea version atrribute
func (*DatasourceBase) SetPluginVersion ¶
func (b *DatasourceBase) SetPluginVersion(verStr string)
SetPluginVersion sets the plugin version string
func (*DatasourceBase) SetVersionConstraints ¶
func (b *DatasourceBase) SetVersionConstraints(verStr string) error
SetVersionConstraints sets the version constraints on Laniakea
type DatasourceGRPCClient ¶
type DatasourceGRPCClient struct {
// contains filtered or unexported fields
}
func (*DatasourceGRPCClient) GetVersion ¶
func (c *DatasourceGRPCClient) GetVersion() (string, error)
GetVersion implements the Datasource interface method GetVersion
func (*DatasourceGRPCClient) PushVersion ¶
func (c *DatasourceGRPCClient) PushVersion(versionNumber string) error
PushVersion implements the Datasource interface method PushVersion
func (*DatasourceGRPCClient) StartRecord ¶
func (c *DatasourceGRPCClient) StartRecord() (chan *proto.Frame, error)
StartRecord implements the Datasource interface method StartRecord
func (*DatasourceGRPCClient) Stop ¶
func (c *DatasourceGRPCClient) Stop() error
Stop implements the Datasource interface method Stop
func (*DatasourceGRPCClient) StopRecord ¶
func (c *DatasourceGRPCClient) StopRecord() error
StopRecord implements the Datasource interface method StopRecord
type DatasourceGRPCServer ¶
type DatasourceGRPCServer struct { proto.UnimplementedDatasourceServer Impl Datasource }
func (*DatasourceGRPCServer) GetVersion ¶
func (s *DatasourceGRPCServer) GetVersion(ctx context.Context, _ *proto.Empty) (*proto.VersionNumber, error)
GetVersion implements the Datsource gRPC server interface
func (*DatasourceGRPCServer) PushVersion ¶
func (s *DatasourceGRPCServer) PushVersion(ctx context.Context, req *proto.VersionNumber) (*proto.Empty, error)
PushVersion implements the Datasource gRPC server interface
func (*DatasourceGRPCServer) StartRecord ¶
func (s *DatasourceGRPCServer) StartRecord(_ *proto.Empty, stream proto.Datasource_StartRecordServer) error
StartRecord implements the Datasource gRPC server interface
func (*DatasourceGRPCServer) StopRecord ¶
func (s *DatasourceGRPCServer) StopRecord(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
StopRecord implements the Datasource gRPC server interface
type DatasourcePlugin ¶
type DatasourcePlugin struct { plugin.Plugin Impl Datasource }
func (*DatasourcePlugin) GRPCClient ¶
func (p *DatasourcePlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient implements the plugin.Plugin interface in the go-plugin package
func (*DatasourcePlugin) GRPCServer ¶
func (p *DatasourcePlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer implements the plugin.Plugin interface in the go-plugin package