aagent

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

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

type AAgent struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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) ManageMachines

func (a *AAgent) ManageMachines(ctx context.Context, wg *sync.WaitGroup) error

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           interface{} `json:"current_state,omitempty" yaml:"current_state,omitempty"`
}

MachineState is the state of a running machine

Directories

Path Synopsis
data
Package model is a generated GoMock package.
Package model is a generated GoMock package.
notifiers
console
Package console is a NotificationService that logs to the console
Package console is a NotificationService that logs to the console

Jump to

Keyboard shortcuts

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