aagent

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AAgent

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

func New

func New(dir string, fw 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 ChoriaProvider

type ChoriaProvider interface {
	PublishRaw(string, []byte) error
	Logger(string) *logrus.Entry
	Identity() string
}

ChoriaProvider provides access to the choria framework

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"`
}

MachineState is the state of a running machine

Directories

Path Synopsis
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