state

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelState

type ModelState struct {
	*domain.StateBase
}

func NewModelState

func NewModelState(factory database.TxnRunnerFactory) *ModelState

NewModelState returns a new ModelState object.

func (*ModelState) CheckMachineExists

func (m *ModelState) 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 (*ModelState) CheckUnitExists

func (m *ModelState) 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 (*ModelState) GetModelUUID

func (m *ModelState) GetModelUUID(ctx context.Context) (model.UUID, error)

GetModelUUID returns the uuid for the model represented by this state.

type State

type State struct {
	*domain.StateBase
}

State is responsible for retrieving a model's running agent version from the database.

func NewState

func NewState(factory database.TxnRunnerFactory) *State

NewState returns a new State object.

func (*State) GetModelTargetAgentVersion

func (st *State) GetModelTargetAgentVersion(ctx context.Context, modelID model.UUID) (version.Number, error)

GetModelTargetAgentVersion returns the agent version for the specified model. If the agent version cannot be found, an error satisfying modelerrors.NotFound will be returned.

Jump to

Keyboard shortcuts

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