Documentation
¶
Index ¶
- Variables
- type CommandsManager
- func (r *CommandsManager) GetMux() srpc.Invoker
- func (r *CommandsManager) GetSubItems(ctx context.Context, req *s4wave_command_registry.GetSubItemsRequest) (*s4wave_command_registry.GetSubItemsResponse, error)
- func (r *CommandsManager) InvokeCommand(ctx context.Context, req *s4wave_command_registry.InvokeCommandRequest) (*s4wave_command_registry.InvokeCommandResponse, error)
- func (r *CommandsManager) RegisterCommand(ctx context.Context, req *s4wave_command_registry.RegisterCommandRequest) (*s4wave_command_registry.RegisterCommandResponse, error)
- func (r *CommandsManager) SetActive(ctx context.Context, req *s4wave_command_registry.SetActiveRequest) (*s4wave_command_registry.SetActiveResponse, error)
- func (r *CommandsManager) SetEnabled(ctx context.Context, req *s4wave_command_registry.SetEnabledRequest) (*s4wave_command_registry.SetEnabledResponse, error)
- func (r *CommandsManager) WatchCommands(req *s4wave_command_registry.WatchCommandsRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
var ErrCommandIdRequired = errors.New("command_id is required")
ErrCommandIdRequired is returned when command_id is empty.
var ErrCommandNotFound = errors.New("command not found")
ErrCommandNotFound is returned when a command is not found.
var ErrCommandRequired = errors.New("command is required")
ErrCommandRequired is returned when command is nil.
var ErrMultipleActiveRegistrations = errors.New("multiple active command registrations")
ErrMultipleActiveRegistrations is returned when more than one registration is active.
var ErrNoHandler = errors.New("command has no handler")
ErrNoHandler is returned when a command has no handler.
var ErrRegistrationNotFound = errors.New("command registration not found")
ErrRegistrationNotFound is returned when a registration is not found.
var ErrResourceIdRequired = errors.New("resource_id is required")
ErrResourceIdRequired is returned when resource_id is empty.
Functions ¶
This section is empty.
Types ¶
type CommandsManager ¶
type CommandsManager struct {
// contains filtered or unexported fields
}
CommandsManager provides an in-memory command registry. Plugins register commands via RegisterCommand and watch for changes via WatchCommands.
func NewCommandsManager ¶
func NewCommandsManager() *CommandsManager
NewCommandsManager creates a new CommandsManager.
func (*CommandsManager) GetMux ¶
func (r *CommandsManager) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*CommandsManager) GetSubItems ¶
func (r *CommandsManager) GetSubItems( ctx context.Context, req *s4wave_command_registry.GetSubItemsRequest, ) (*s4wave_command_registry.GetSubItemsResponse, error)
GetSubItems returns sub-items for the active registration of a command.
func (*CommandsManager) InvokeCommand ¶
func (r *CommandsManager) InvokeCommand( ctx context.Context, req *s4wave_command_registry.InvokeCommandRequest, ) (*s4wave_command_registry.InvokeCommandResponse, error)
InvokeCommand invokes a registered command.
func (*CommandsManager) RegisterCommand ¶
func (r *CommandsManager) RegisterCommand( ctx context.Context, req *s4wave_command_registry.RegisterCommandRequest, ) (*s4wave_command_registry.RegisterCommandResponse, error)
RegisterCommand registers a command with an optional handler.
func (*CommandsManager) SetActive ¶
func (r *CommandsManager) SetActive( ctx context.Context, req *s4wave_command_registry.SetActiveRequest, ) (*s4wave_command_registry.SetActiveResponse, error)
SetActive sets the active state of a registration.
func (*CommandsManager) SetEnabled ¶
func (r *CommandsManager) SetEnabled( ctx context.Context, req *s4wave_command_registry.SetEnabledRequest, ) (*s4wave_command_registry.SetEnabledResponse, error)
SetEnabled sets the enabled state of a registration.
func (*CommandsManager) WatchCommands ¶
func (r *CommandsManager) WatchCommands( req *s4wave_command_registry.WatchCommandsRequest, strm s4wave_command_registry.SRPCCommandRegistryResourceService_WatchCommandsStream, ) error
WatchCommands streams the full command registry with active state.