Documentation ¶
Overview ¶
Core interfaces and data structures that are used throughout AgentController
Index ¶
Constants ¶
View Source
const ( COMMAND_STATE_QUEUED = "QUEUED" COMMAND_STATE_RUNNING = "RUNNING" COMMAND_STATE_ERROR = "ERROR" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentInformationStorage ¶
type AgentInformationStorage interface { // Sets the roles associated with an Agent SetRoles(id AgentID, roles []AgentRole) // Gets the roles associated with an Agent GetRoles(id AgentID) []AgentRole // Drops all the known information about an Agent DropAgent(id AgentID) // Checks if the specified agent has the specified role HasRole(id AgentID, role AgentRole) bool // Queries for all the available Agents ConnectedAgents() []AgentID // Queries for all the available agents that specify the given criteria: // - If gid is not nil, only returns IDs of Agents with that GID // - if roles is not nil, only returns IDs of Agents that have all of these roles FilteredConnectedAgents(gid *uint, roles []AgentRole) []AgentID IsConnected(id AgentID) bool }
Information about all things Agents
type CommandLogger ¶
type CommandResult ¶
type CommandStorage ¶
type CommandStorage interface { // Queues a received command QueueReceivedCommand(agentID AgentID, command *Command) error // Returns a channel of commands for the specified agents // Always returns the same channel for the same AgentID // Whatever internal implementation errors that arise in the command-producing channels should be handled // discretely CommandsForAgent(agentID AgentID) <-chan Command // Report that this command was dequeued for delivery to that agent but delivery to said Agent // failed for one reason or another ReportUndeliveredCommand(agentID AgentID, command *Command) error // Store the result of a command SetCommandResult(result *CommandResult) error }
Persisted storage for incoming commands
type Incoming ¶
type Incoming interface { // Receives and returns a single command without blocking, returning nil if there weren't any ReceiveCommand() (*Command, error) // Checks if the error is about a badly formatted incoming command IsCommandFormatError(err error) bool }
AgentController's command input interface to its clients
Click to show internal directories.
Click to hide internal directories.