Documentation
¶
Index ¶
- Constants
- type BeeBusyChecker
- type BeeExecutionActivityChecker
- type BeeStopper
- type ClearCommandHandler
- type ClearService
- type EngineCommandHandler
- type EngineValidator
- type ListCommandHandler
- type MessageActivityChecker
- type SessionContextLister
- type StatusCommandDeps
- type StatusCommandHandler
- type StopCommandHandler
- type StopMessageStore
- type SystemConfigWriter
- type TaskBySessionLister
- type WorkerBusyChecker
- type WorkerByIDsLookup
- type WorkerExecutionActivityChecker
- type WorkerLister
- type WorkerNameLookup
- type WorkerRepository
- type WorkerTaskActivityChecker
Constants ¶
const ( // CmdEngine is the slash command that switches engines. CmdEngine = "/engine" // CmdClear is the slash command that clears session contexts. CmdClear = "/clear" // CmdStop is the slash command that stops the running bee and cancels pending messages. CmdStop = "/stop" // CmdStatus is the slash command that prints the current session status. CmdStatus = "/status" )
const CmdList = "/list"
CmdList is the slash command that prints the worker directory.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeeBusyChecker ¶ added in v0.0.34
type BeeBusyChecker interface {
MessageActivityChecker
BeeExecutionActivityChecker
}
BeeBusyChecker gates bee-level engine switches.
func NewBeeBusyChecker ¶ added in v0.0.34
func NewBeeBusyChecker(msg MessageActivityChecker, exec BeeExecutionActivityChecker) BeeBusyChecker
type BeeExecutionActivityChecker ¶ added in v0.0.34
type BeeExecutionActivityChecker interface {
HasActiveBeeExecutions(ctx context.Context) (bool, error)
}
BeeExecutionActivityChecker reports whether active bee-owned executions exist.
type BeeStopper ¶ added in v0.0.31
type ClearCommandHandler ¶
type ClearCommandHandler struct {
// contains filtered or unexported fields
}
func NewClearCommandHandler ¶
func NewClearCommandHandler( workers WorkerNameLookup, svc ClearService, senders map[string]platform.PlatformSenderAdapter, runningExecs utils.RunningExecLookup, ) *ClearCommandHandler
func (*ClearCommandHandler) HandleCommand ¶
func (h *ClearCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool
func (*ClearCommandHandler) IsCommand ¶ added in v0.0.29
func (h *ClearCommandHandler) IsCommand(content string) bool
type ClearService ¶ added in v0.0.39
type ClearService interface {
EvaluateClearSession(ctx context.Context, sessionKey string) (session.ClearSessionPreview, error)
ClearSession(ctx context.Context, sessionKey string, preview session.ClearSessionPreview) (session.ClearSessionResult, error)
EvaluateClearWorker(ctx context.Context, sessionKey string, w model.Worker) (session.ClearWorkerPreview, error)
ClearWorker(ctx context.Context, sessionKey string, w model.Worker, preview session.ClearWorkerPreview) (session.ClearWorkerResult, error)
}
ClearService is the destructive-ops surface used by the /clear handler. Implemented by *session.ClearService.
type EngineCommandHandler ¶
type EngineCommandHandler struct {
// contains filtered or unexported fields
}
EngineCommandHandler handles the /engine slash command.
func NewEngineCommandHandler ¶
func NewEngineCommandHandler( workers WorkerRepository, sysCfg SystemConfigWriter, senders map[string]platform.PlatformSenderAdapter, validator EngineValidator, beeBusy BeeBusyChecker, workerBusy WorkerBusyChecker, engineCfg *enginecfg.Store, ) *EngineCommandHandler
func (*EngineCommandHandler) HandleCommand ¶
func (h *EngineCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool
func (*EngineCommandHandler) IsCommand ¶ added in v0.0.29
func (h *EngineCommandHandler) IsCommand(content string) bool
type EngineValidator ¶
EngineValidator validates engine names against the set of enabled engines.
type ListCommandHandler ¶ added in v0.0.37
type ListCommandHandler struct {
// contains filtered or unexported fields
}
ListCommandHandler handles the /list slash command.
func NewListCommandHandler ¶ added in v0.0.37
func NewListCommandHandler(workers WorkerLister, senders map[string]platform.PlatformSenderAdapter) *ListCommandHandler
func (*ListCommandHandler) HandleCommand ¶ added in v0.0.37
func (h *ListCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool
func (*ListCommandHandler) IsCommand ¶ added in v0.0.37
func (h *ListCommandHandler) IsCommand(content string) bool
type MessageActivityChecker ¶
MessageActivityChecker reports whether active platform messages exist.
type SessionContextLister ¶ added in v0.0.34
type SessionContextLister interface {
ListActiveSessionContexts(ctx context.Context, sessionKey, beeEngine string) ([]store.SessionAgent, error)
}
SessionContextLister is shared by /status and /clear.
type StatusCommandDeps ¶ added in v0.0.39
type StatusCommandDeps struct {
Sessions SessionContextLister
Tasks TaskBySessionLister
Workers WorkerByIDsLookup
Senders map[string]platform.PlatformSenderAdapter
EngineCfg *enginecfg.Store
RunningExecs utils.RunningExecLookup
}
StatusCommandDeps bundles the collaborators NewStatusCommandHandler needs.
type StatusCommandHandler ¶ added in v0.0.34
type StatusCommandHandler struct {
// contains filtered or unexported fields
}
func NewStatusCommandHandler ¶ added in v0.0.34
func NewStatusCommandHandler(deps StatusCommandDeps) *StatusCommandHandler
func (*StatusCommandHandler) HandleCommand ¶ added in v0.0.34
func (h *StatusCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool
func (*StatusCommandHandler) IsCommand ¶ added in v0.0.34
func (h *StatusCommandHandler) IsCommand(content string) bool
type StopCommandHandler ¶ added in v0.0.31
type StopCommandHandler struct {
// contains filtered or unexported fields
}
func NewStopCommandHandler ¶ added in v0.0.31
func NewStopCommandHandler( feeder BeeStopper, msgs StopMessageStore, senders map[string]platform.PlatformSenderAdapter, ) *StopCommandHandler
func (*StopCommandHandler) HandleCommand ¶ added in v0.0.31
func (h *StopCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool
func (*StopCommandHandler) IsCommand ¶ added in v0.0.31
func (h *StopCommandHandler) IsCommand(content string) bool
type StopMessageStore ¶ added in v0.0.31
type SystemConfigWriter ¶
SystemConfigWriter is the subset of SystemConfigStore needed by EngineCommandHandler.
type TaskBySessionLister ¶ added in v0.0.34
type TaskBySessionLister interface {
List(ctx context.Context, f store.TaskFilter) ([]model.Task, error)
}
TaskBySessionLister is shared by /status and /clear.
type WorkerBusyChecker ¶ added in v0.0.34
type WorkerBusyChecker interface {
WorkerExecutionActivityChecker
WorkerTaskActivityChecker
}
WorkerBusyChecker gates worker-level engine switches.
func NewWorkerBusyChecker ¶ added in v0.0.34
func NewWorkerBusyChecker(exec WorkerExecutionActivityChecker, task WorkerTaskActivityChecker) WorkerBusyChecker
type WorkerByIDsLookup ¶ added in v0.0.37
type WorkerExecutionActivityChecker ¶ added in v0.0.34
type WorkerExecutionActivityChecker interface {
HasActiveExecutionsByWorkerID(ctx context.Context, workerID string) (bool, error)
}
WorkerExecutionActivityChecker reports whether active executions exist for a specific worker.
type WorkerLister ¶ added in v0.0.37
WorkerLister is the subset of WorkerStore needed by ListCommandHandler.