Documentation
¶
Index ¶
- type MemoryState
- func (*MemoryState) AgentVersion(_ context.Context) (string, error)
- func (s *MemoryState) AllKeysQuery() string
- func (s *MemoryState) KeysQuery(query string) ([]string, error)
- func (s *MemoryState) ModelConfig(_ context.Context) (map[string]string, error)
- func (s *MemoryState) ModelConfigHasAttributes(_ context.Context, hasAttrs []string) ([]string, error)
- func (s *MemoryState) SetModelConfig(ctx context.Context, conf map[string]string) error
- func (st *MemoryState) SpaceExists(ctx context.Context, spaceName string) (bool, error)
- func (s *MemoryState) UpdateModelConfig(ctx context.Context, update map[string]string, remove []string) error
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 ¶
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 ¶
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 ¶
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.