Documentation ¶
Index ¶
- func RegisterMachinePlugin(plugin model.MachineConstructor) error
- type AAgent
- func (a *AAgent) AllMachineStates() (states []MachineState, err error)
- func (a *AAgent) LoadPlugin(ctx context.Context, p model.MachineConstructor) error
- func (a *AAgent) ManageMachines(ctx context.Context, wg *sync.WaitGroup) error
- func (a *AAgent) Transition(name string, version string, path string, id string, transition string) error
- type MachineState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMachinePlugin ¶ added in v0.24.0
func RegisterMachinePlugin(plugin model.MachineConstructor) error
RegisterMachinePlugin registers a new compile time constructed machine
Types ¶
type AAgent ¶
func New ¶
func New(dir string, fw model.ChoriaProvider) (aa *AAgent, err error)
New creates a new instance of the choria autonomous agent host
func (*AAgent) AllMachineStates ¶
func (a *AAgent) AllMachineStates() (states []MachineState, err error)
AllMachineStates retrieves a list of machines and their states
func (*AAgent) LoadPlugin ¶ added in v0.29.0
LoadPlugin allows for runtime loading of plugins into a running autonomous agent subsystem.
func (*AAgent) ManageMachines ¶
ManageMachines start observing the source directories starting and stopping machines based on changes on disk
func (*AAgent) Transition ¶
func (a *AAgent) Transition(name string, version string, path string, id string, transition string) error
Transition transitions a running machine using a supplied transition event. Success is not guaranteed as the machine might be in a state that does not allow the transition
type MachineState ¶
type MachineState struct { Name string `json:"name" yaml:"name"` Version string `json:"version" yaml:"version"` State string `json:"state" yaml:"state"` Path string `json:"path" yaml:"path"` ID string `json:"id" yaml:"id"` StartTimeUTC int64 `json:"start_time" yaml:"start_time"` AvailableTransitions []string `json:"available_transitions" yaml:"available_transitions"` Scout bool `json:"scout" yaml:"scout"` ScoutState any `json:"current_state,omitempty" yaml:"current_state,omitempty"` }
MachineState is the state of a running machine
Click to show internal directories.
Click to hide internal directories.