state

package
v0.0.0-...-0a82276 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerState

type ControllerState struct {
	*domain.StateBase
}

ControllerState provides a state access layer for accessing a controller's ssh keys via controller config.

func NewControllerState

func NewControllerState(factory database.TxnRunnerFactory) *ControllerState

NewControllerState constructs a new state for interacting with the underlying authorised keys of a controller via controller config.

func (*ControllerState) GetControllerConfigKeys

func (st *ControllerState) GetControllerConfigKeys(
	ctx context.Context,
	keys []string,
) (map[string]string, error)

GetControllerConfigKeys returns the controller config key and values for the keys supplied. If one or more keys supplied do not exist in the controller's config they will be omitted from the final result.

func (*ControllerState) GetUserAuthorizedKeysForModel

func (s *ControllerState) GetUserAuthorizedKeysForModel(
	ctx context.Context,
	modelUUID model.UUID,
) ([]string, error)

GetUserAuthorizedKeysForModel is responsible for returning all of the user authorized keys for a model. The following errors can be expected: - modelerrors.NotFound if the model does not exist.

type State

type State struct {
	*domain.StateBase
}

State defines the access mechanism for interacting with authorized keys in the context of the model database.

func NewState

func NewState(factory database.TxnRunnerFactory) *State

NewState constructs a new state for interacting with the underlying authorised keys of a model.

func (*State) CheckMachineExists

func (s *State) CheckMachineExists(
	ctx context.Context,
	name coremachine.Name,
) error

CheckMachineExists checks 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) GetModelUUID

func (s *State) GetModelUUID(ctx context.Context) (model.UUID, error)

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

Jump to

Keyboard shortcuts

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