testing

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryState

type MemoryState struct {
	Config map[string]string
	*testing.NamespaceWatcherFactory
}

MemoryState implements an in memory representation of the state required for managing model config.

func NewState

func NewState() *MemoryState

NewState constructs a new in memory state for model config.

func (*MemoryState) AgentVersion

func (*MemoryState) AgentVersion(_ context.Context) (string, error)

func (*MemoryState) AllKeysQuery

func (s *MemoryState) AllKeysQuery() string

AllKeysQuery implements the AllKeysQuery func required by state.

func (*MemoryState) KeysQuery

func (s *MemoryState) KeysQuery(query string) ([]string, error)

KeysQuery performs a query for all of the model config keys currently set and returns them as a slice of strings. If they query does not match allKeysQuery then an error is returned.

func (*MemoryState) ModelConfig

func (s *MemoryState) ModelConfig(_ context.Context) (map[string]string, error)

ModelConfig returns the currently set config for the model.

func (*MemoryState) ModelConfigHasAttributes

func (s *MemoryState) ModelConfigHasAttributes(
	_ context.Context,
	hasAttrs []string,
) ([]string, error)

ModelConfigHasAttributes returns the set of attributes that model config currently has set out of the list supplied.

func (*MemoryState) SetModelConfig

func (s *MemoryState) SetModelConfig(
	ctx context.Context,
	conf map[string]string,
) error

SetModelConfig is responsible for setting the current model config and overwriting all previously set values even if the config supplied is empty or nil.

func (*MemoryState) SpaceExists

func (st *MemoryState) SpaceExists(ctx context.Context, spaceName string) (bool, error)

SpaceExists checks if the space identified by the given space name exists.

func (*MemoryState) UpdateModelConfig

func (s *MemoryState) UpdateModelConfig(
	ctx context.Context,
	update map[string]string,
	remove []string,
) error

UpdateModelConfig is responsible for both inserting, updating and removing model config values for the current model.

Jump to

Keyboard shortcuts

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