agent

package
v0.0.0-...-12a582f Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAborted means any work was abandoned
	ErrAborted = errors.New("aborted")

	// ErrStatusUnknown we are unsure of any status of a provisioner
	ErrStatusUnknown = errors.New("no known status known")

	// ErrFailed means the agent has failed to do it's work
	ErrFailed = errors.New("failed")
)

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID uuid.UUID

	Provider     providers.Provider
	ProviderName string
	Target       target.Target
	Parameters   parameters.Parameters
	Guards       []*guard.Guard
	Probes       []*probe.Probe

	Next *Agent
	// contains filtered or unexported fields
}

Agent is a worker that accepts a declaration and provisioner and completes the work to manage state and resolve it. for example, provisioning a new node

func NewAgent

func NewAgent(prov providers.Provider) *Agent

NewAgent instantiates an Agent with defaults

func Parse

func Parse(p plan.Definition) ([]*Agent, error)

Parse takes a plan and constructs a workflow of agents as a sequence to be executed

func (*Agent) Reconcile

func (a *Agent) Reconcile() (Status, error)

Reconcile checks the current status of a process being managed and ensures the state is resolved

func (*Agent) State

func (a *Agent) State() Status

State returns the state of a process managed by an Agent

type Status

type Status int

Status is the status of a agent that is completing work

const (
	// Submitted signals that work has been received
	Submitted Status = iota

	// Provisioning signals that things are being set up
	Provisioning

	// Running signals the work is being undertaken
	Running

	// Aborted signals the work was abandoned
	Aborted

	// Failed signals the attempted work failed to complete with an error
	Failed

	// Complete signals any work has successfully reached the end of it's lifecycle
	Complete
)

Jump to

Keyboard shortcuts

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