state

package
v0.0.0-...-f88c608 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	*domain.StateBase
}

func NewState

func NewState(factory database.TxnRunnerFactory) *State

NewState returns a new State object.

func (*State) CheckMachineExists

func (m *State) CheckMachineExists(
	ctx context.Context,
	name machine.Name,
) error

CheckMachineExists check to see if the given machine exists in the model. If the machine does not exist an error satisfying machineerrors.MachineNotFound is returned.

func (*State) CheckUnitExists

func (m *State) CheckUnitExists(
	ctx context.Context,
	name string,
) error

CheckUnitExists checks to see if the given unit exists in the model. If the unit does not exist an error satisfying applicationerrors.UnitNotFound is returned.

func (*State) GetTargetAgentVersion

func (st *State) GetTargetAgentVersion(ctx context.Context) (version.Number, error)

GetTargetAgentVersion returns the agent version for the model. If the agent_version table has no data, modelerrors.AgentVersionNotFound is returned.

Jump to

Keyboard shortcuts

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