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: 8 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
}

State is responsible for accessing the controller/model DB to retrieve the controller/model config keys required for the container config.

func NewState

func NewState(modelFactory database.TxnRunnerFactory) *State

NewState creates a new State object.

func (*State) GetModelConfigKeyValues

func (s *State) GetModelConfigKeyValues(
	ctx context.Context,
	keys ...string,
) (map[string]string, error)

GetModelConfigKeyValues returns the values of the specified model config keys from the model database. If a key cannot be found in model config, it will be omitted from the result. If no keys are specified, then this method returns an empty map.

func (*State) ModelID

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

ModelID returns the UUID of the current model. If the model cannot be found, an error is returned satisfying modelerrors.NotFound.

Jump to

Keyboard shortcuts

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