control

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Type   CommandType
	Target string // Agent name for individual commands, empty for all commands
}

Command represents a parsed control command

type CommandType

type CommandType int

CommandType represents the type of control command

const (
	// CommandUnknown represents an unrecognized command
	CommandUnknown CommandType = iota
	// CommandStop represents a stop command
	CommandStop
	// CommandResume represents a resume command
	CommandResume
	// CommandStopAll represents a stop all command
	CommandStopAll
	// CommandResumeAll represents a resume all command
	CommandResumeAll
	// CommandKill represents a force kill command
	CommandKill
)

func (CommandType) String

func (c CommandType) String() string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles control commands

func NewHandler

func NewHandler(pool *worker.Pool) *Handler

NewHandler creates a new control command handler

func (*Handler) Handle

func (h *Handler) Handle(input string) *Result

Handle parses and executes a control command Returns nil if the input is not a control command

func (*Handler) IsControlCommand

func (h *Handler) IsControlCommand(input string) bool

IsControlCommand checks if the input is a control command

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses control commands from input text

func NewParser

func NewParser() *Parser

NewParser creates a new control command parser

func (*Parser) IsControlCommand

func (p *Parser) IsControlCommand(input string) bool

IsControlCommand returns true if the input is a control command

func (*Parser) Parse

func (p *Parser) Parse(input string) *Command

Parse parses the input text and returns a Command if recognized

type Result

type Result struct {
	Success bool
	Message string
}

Result represents the result of a control command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL