Documentation ¶
Index ¶
- Constants
- func ChangeCfgExec(os string, cfgs []*lanirpc.PluginConfig) []*lanirpc.PluginConfig
- func ValidatePluginConfig(cfg *lanirpc.PluginConfig, pluginDir string, isTesting bool) error
- type LogWriter
- type PluginInstance
- type PluginLogger
- func (l *PluginLogger) Debug(msg string, args ...interface{})
- func (l *PluginLogger) Error(msg string, args ...interface{})
- func (l *PluginLogger) ImpliedArgs() []interface{}
- func (l *PluginLogger) Info(msg string, args ...interface{})
- func (l *PluginLogger) IsDebug() bool
- func (l *PluginLogger) IsError() bool
- func (l *PluginLogger) IsInfo() bool
- func (l *PluginLogger) IsTrace() bool
- func (l *PluginLogger) IsWarn() bool
- func (l *PluginLogger) Log(level hclog.Level, msg string, args ...interface{})
- func (l *PluginLogger) Name() string
- func (l *PluginLogger) Named(name string) hclog.Logger
- func (l *PluginLogger) ResetNamed(name string) hclog.Logger
- func (l *PluginLogger) SetLevel(level hclog.Level)
- func (l *PluginLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
- func (l *PluginLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
- func (l *PluginLogger) Trace(msg string, args ...interface{})
- func (l *PluginLogger) Warn(msg string, args ...interface{})
- func (l *PluginLogger) With(args ...interface{}) hclog.Logger
- type PluginManager
- func (p *PluginManager) AddMacaroonService(service *macaroons.Service)
- func (p *PluginManager) AddPermission(method string, ops []bakery.Op) error
- func (p *PluginManager) AddPermissions(perms map[string][]bakery.Op) error
- func (p *PluginManager) AddPlugin(ctx context.Context, req *lanirpc.PluginConfig) (*lanirpc.Plugin, error)
- func (p *PluginManager) Command(req *lanirpc.ControllerPluginRequest, stream lanirpc.PluginAPI_CommandServer) error
- func (p *PluginManager) GetPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*lanirpc.Plugin, error)
- func (p *PluginManager) ListPlugins(ctx context.Context, _ *proto.Empty) (*lanirpc.PluginsList, error)
- func (p *PluginManager) Ping(ctx context.Context) error
- func (p *PluginManager) RegisterWithGrpcServer(grpcServer *grpc.Server) error
- func (p *PluginManager) RegisterWithRestProxy(ctx context.Context, mux *proxy.ServeMux, restDialOpts []grpc.DialOption, ...) error
- func (p *PluginManager) Start(ctx context.Context) error
- func (p *PluginManager) StartPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
- func (p *PluginManager) StartRecord(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
- func (p *PluginManager) Stop() error
- func (p *PluginManager) StopPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
- func (p *PluginManager) StopRecord(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
- func (p *PluginManager) Subscribe(req *lanirpc.PluginRequest, stream lanirpc.PluginAPI_SubscribeServer) error
- func (p *PluginManager) SubscribePluginState(req *lanirpc.PluginRequest, ...) error
- type PluginRecordState
- type StateListener
Constants ¶
const ( ErrInvalidPluginExec = bg.Error("invalid plugin executable") ErrPluginExecNotFound = bg.Error("plugin executable not found") ErrInvalidPluginType = bg.Error("invalid plugin type") )
const ( DATASOURCE_STR = "datasource" CONTROLLER_STR = "controller" ErrInvalidPluginString = bg.Error("invalid plugin string") ErrDuplicatePluginName = bg.Error("identical plugin names") ErrUnregsiteredPlugin = bg.Error("given plugin not in plugin registry") ErrPluginNotReady = bg.Error("plugin not ready") ErrPluginTimeout = bg.Error("plugin timed out") PluginEOF = "plugin EOF" )
const (
ErrPluginNotStarted = bg.Error("plugin not started")
)
const (
MissingKey = "EXTRA_VALUE_AT_END"
)
Variables ¶
This section is empty.
Functions ¶
func ChangeCfgExec ¶
func ChangeCfgExec(os string, cfgs []*lanirpc.PluginConfig) []*lanirpc.PluginConfig
func ValidatePluginConfig ¶
func ValidatePluginConfig(cfg *lanirpc.PluginConfig, pluginDir string, isTesting bool) error
ValidatePluginConfig takes a PluginConfig and validates the parameters
Types ¶
type PluginInstance ¶
type PluginLogger ¶
type PluginLogger struct {
// contains filtered or unexported fields
}
func NewPluginLogger ¶
func NewPluginLogger(name string, logger *zerolog.Logger) *PluginLogger
func (*PluginLogger) Debug ¶
func (l *PluginLogger) Debug(msg string, args ...interface{})
func (*PluginLogger) Error ¶
func (l *PluginLogger) Error(msg string, args ...interface{})
func (*PluginLogger) ImpliedArgs ¶
func (l *PluginLogger) ImpliedArgs() []interface{}
ImpliedArgs returns the loggers implied args
func (*PluginLogger) Info ¶
func (l *PluginLogger) Info(msg string, args ...interface{})
func (*PluginLogger) IsDebug ¶
func (l *PluginLogger) IsDebug() bool
IsDebug checks if the current logger level is set to Debug TODO:SSSOCPaulCote - Make new config option for log level and integrate into pluggin logger as well
func (*PluginLogger) IsError ¶
func (l *PluginLogger) IsError() bool
IsError checks if the current logger level is set to Error TODO:SSSOCPaulCote - Make new config option for log level and integrate into pluggin logger as well
func (*PluginLogger) IsInfo ¶
func (l *PluginLogger) IsInfo() bool
IsInfo checks if the current logger level is set to Info TODO:SSSOCPaulCote - Make new config option for log level and integrate into pluggin logger as well
func (*PluginLogger) IsTrace ¶
func (l *PluginLogger) IsTrace() bool
IsTrace checks if the current logger level is set to Trace TODO:SSSOCPaulCote - Make new config option for log level and integrate into pluggin logger as well
func (*PluginLogger) IsWarn ¶
func (l *PluginLogger) IsWarn() bool
IsWarn checks if the current logger level is set to Warn TODO:SSSOCPaulCote - Make new config option for log level and integrate into pluggin logger as well
func (*PluginLogger) Log ¶
func (l *PluginLogger) Log(level hclog.Level, msg string, args ...interface{})
func (*PluginLogger) Name ¶
func (l *PluginLogger) Name() string
Name returns the name of the Logger
func (*PluginLogger) Named ¶
func (l *PluginLogger) Named(name string) hclog.Logger
Creates a new sub-logger with added name
func (*PluginLogger) ResetNamed ¶
func (l *PluginLogger) ResetNamed(name string) hclog.Logger
ResetNamed returns a new sub-logger with the given name
func (*PluginLogger) SetLevel ¶
func (l *PluginLogger) SetLevel(level hclog.Level)
SetLevel doesn't do anything right now, just satisfies the interface
func (*PluginLogger) StandardLogger ¶
func (l *PluginLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
StandardLogger returns a go standard library logger
func (*PluginLogger) StandardWriter ¶
func (l *PluginLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
StandardWriter returns an io package standard writer
func (*PluginLogger) Trace ¶
func (l *PluginLogger) Trace(msg string, args ...interface{})
func (*PluginLogger) Warn ¶
func (l *PluginLogger) Warn(msg string, args ...interface{})
func (*PluginLogger) With ¶
func (l *PluginLogger) With(args ...interface{}) hclog.Logger
With returns a new sublogger using new key/value pairs in the log output
type PluginManager ¶
type PluginManager struct { lanirpc.UnimplementedPluginAPIServer sync.WaitGroup // contains filtered or unexported fields }
func NewPluginManager ¶
func NewPluginManager(pluginDir string, pluginCfgs []*lanirpc.PluginConfig, zl zerolog.Logger, noMacaroons bool) *PluginManager
NewPluginManager takes a list of plugins, parses those plugin strings and instantiates a PluginManager
func (*PluginManager) AddMacaroonService ¶
func (p *PluginManager) AddMacaroonService(service *macaroons.Service)
Adds the macaroon service provided to GrpcInterceptor struct attributes
func (*PluginManager) AddPermission ¶
func (p *PluginManager) AddPermission(method string, ops []bakery.Op) error
AddPermission adds a new macaroon rule for the given method
func (*PluginManager) AddPermissions ¶
func (p *PluginManager) AddPermissions(perms map[string][]bakery.Op) error
AddPermissions adds the inputted permission to the permissionMap attribute of the GrpcInterceptor struct
func (*PluginManager) AddPlugin ¶
func (p *PluginManager) AddPlugin(ctx context.Context, req *lanirpc.PluginConfig) (*lanirpc.Plugin, error)
AddPlugin is the PluginAPI command to add a new plugin from a formatted plugin string
func (*PluginManager) Command ¶
func (p *PluginManager) Command(req *lanirpc.ControllerPluginRequest, stream lanirpc.PluginAPI_CommandServer) error
Command is the PluginAPI command for sending an arbitrary amount of data to a controller service
func (*PluginManager) GetPlugin ¶
func (p *PluginManager) GetPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*lanirpc.Plugin, error)
GetPlugin will retrieve the plugin information for a given plugin if it exists
func (*PluginManager) ListPlugins ¶
func (p *PluginManager) ListPlugins(ctx context.Context, _ *proto.Empty) (*lanirpc.PluginsList, error)
ListPlugins is the PluginAPI command for listing all plugins in the plugin registry along with pertinent information about each one
func (*PluginManager) Ping ¶
func (p *PluginManager) Ping(ctx context.Context) error
Ping implements the health package RegisteredHealthService interface TODO:SSSOCPaulCote - This should do more, it should actually probe the service to make sure everything is operating nominally
func (*PluginManager) RegisterWithGrpcServer ¶
func (p *PluginManager) RegisterWithGrpcServer(grpcServer *grpc.Server) error
RegisterWithGrpcServer registers the PluginManager with the root gRPC server.
func (*PluginManager) RegisterWithRestProxy ¶
func (p *PluginManager) RegisterWithRestProxy(ctx context.Context, mux *proxy.ServeMux, restDialOpts []grpc.DialOption, restProxyDest string) error
RegisterWithRestProxy registers the RPC Server with the REST proxy
func (*PluginManager) Start ¶
func (p *PluginManager) Start(ctx context.Context) error
Start creates the connection to all registered plugins and establishes the connection to the API service
func (*PluginManager) StartPlugin ¶
func (p *PluginManager) StartPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
StartPlugin is the PluginAPI command to start an existiing plugin
func (*PluginManager) StartRecord ¶
func (p *PluginManager) StartRecord(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
StartRecord is the PluginAPI command which exposes the StartRecord method of all registered datasource plugins
func (*PluginManager) Stop ¶
func (p *PluginManager) Stop() error
Stop kills all plugin sub-processes safely
func (*PluginManager) StopPlugin ¶
func (p *PluginManager) StopPlugin(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
StopPlugin is the PluginAPI command to stop a given plugin gracefully
func (*PluginManager) StopRecord ¶
func (p *PluginManager) StopRecord(ctx context.Context, req *lanirpc.PluginRequest) (*proto.Empty, error)
StopRecord is the PluginAPI command which exposes the StopRecord method of all registered datasource plugins
func (*PluginManager) Subscribe ¶
func (p *PluginManager) Subscribe(req *lanirpc.PluginRequest, stream lanirpc.PluginAPI_SubscribeServer) error
Subscribe is the PluginAPI command which exposes the data stream of any datasource plugin
func (*PluginManager) SubscribePluginState ¶
func (p *PluginManager) SubscribePluginState(req *lanirpc.PluginRequest, stream lanirpc.PluginAPI_SubscribePluginStateServer) error
SubscribePluginState implements the gRPC method of the same name. It subscribes a client to the given plugins state updates
type PluginRecordState ¶
type PluginRecordState int32
const ( NOTRECORDING PluginRecordState = iota RECORDING )
type StateListener ¶
type StateListener struct { IsConnected bool Signal chan lanirpc.PluginState }