stores

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfigStore

func BuildConfigStore(options opts.Options, source opts.ConfigSource, apiSourceFinishedLoading func()) (internal.ConfigStoreGetter, bool, error)

Types

type APIConfigStore

type APIConfigStore struct {
	sync.RWMutex
	Initialized bool
	// contains filtered or unexported fields
}

func NewAPIConfigStore

func NewAPIConfigStore(options options.Options, finishedLoading func()) (*APIConfigStore, error)

func (*APIConfigStore) GetConfig

func (cs *APIConfigStore) GetConfig(key string) (*prefabProto.Config, bool)

GetConfig retrieves a Config associated with the given key. It returns a pointer to the Config and a boolean value. The Config pointer is nil if the key does not exist in the store. The boolean value is true if the key exists, and false otherwise.

func (*APIConfigStore) GetContextValue

func (cs *APIConfigStore) GetContextValue(propertyName string) (interface{}, bool)

func (*APIConfigStore) GetHighWatermark

func (cs *APIConfigStore) GetHighWatermark() int64

func (*APIConfigStore) GetProjectEnvID

func (cs *APIConfigStore) GetProjectEnvID() int64

func (*APIConfigStore) Keys

func (cs *APIConfigStore) Keys() []string

func (*APIConfigStore) Len

func (cs *APIConfigStore) Len() int

func (*APIConfigStore) SetConfigs

func (cs *APIConfigStore) SetConfigs(configs []*prefabProto.Config, envID int64)

func (*APIConfigStore) SetFromConfigsProto

func (cs *APIConfigStore) SetFromConfigsProto(configs *prefabProto.Configs)

type CompositeConfigStore

type CompositeConfigStore struct {
	// contains filtered or unexported fields
}

CompositeConfigStore is a config store that composes multiple config stores. It attempts to find a config by key in each store in the order they were provided. The first store that contains the requested config is used, and the search stops. If no store contains the requested config, the CompositeConfigStore returns false to indicate that the config does not exist.

func BuildCompositeConfigStore

func BuildCompositeConfigStore(stores ...internal.ConfigStoreGetter) *CompositeConfigStore

func (*CompositeConfigStore) GetConfig

func (s *CompositeConfigStore) GetConfig(key string) (*prefabProto.Config, bool)

func (*CompositeConfigStore) GetContextValue

func (s *CompositeConfigStore) GetContextValue(propertyName string) (interface{}, bool)

func (*CompositeConfigStore) GetProjectEnvID

func (s *CompositeConfigStore) GetProjectEnvID() int64

func (*CompositeConfigStore) Keys

func (s *CompositeConfigStore) Keys() []string

type ConfigDumpConfigStore

type ConfigDumpConfigStore struct {
	ProjectEnvID int64
	Initialized  bool
	// contains filtered or unexported fields
}

func NewConfigDumpConfigStore

func NewConfigDumpConfigStore(path string, projectEnvID int64) (*ConfigDumpConfigStore, error)

func (*ConfigDumpConfigStore) GetConfig

func (s *ConfigDumpConfigStore) GetConfig(key string) (*prefabProto.Config, bool)

func (*ConfigDumpConfigStore) GetContextValue

func (s *ConfigDumpConfigStore) GetContextValue(_ string) (value interface{}, valueExists bool)

func (*ConfigDumpConfigStore) GetProjectEnvID

func (s *ConfigDumpConfigStore) GetProjectEnvID() int64

func (*ConfigDumpConfigStore) Keys

func (s *ConfigDumpConfigStore) Keys() []string

type LocalConfigStore

type LocalConfigStore struct {
	Initialized bool
	// contains filtered or unexported fields
}

func NewLocalConfigStore

func NewLocalConfigStore(path string) (*LocalConfigStore, error)

func (*LocalConfigStore) GetConfig

func (s *LocalConfigStore) GetConfig(key string) (*prefabProto.Config, bool)

func (*LocalConfigStore) GetContextValue

func (s *LocalConfigStore) GetContextValue(_ string) (value interface{}, valueExists bool)

func (*LocalConfigStore) GetProjectEnvID

func (s *LocalConfigStore) GetProjectEnvID() int64

func (*LocalConfigStore) Keys

func (s *LocalConfigStore) Keys() []string

type MemoryConfigStore added in v0.0.5

type MemoryConfigStore struct {
	ProjectEnvID int64
	// contains filtered or unexported fields
}

MemoryConfigStore is a simple in-memory key-value store.

func NewMemoryConfigStore added in v0.0.5

func NewMemoryConfigStore(projectEnvID int64, rawConfigs map[string]interface{}) (*MemoryConfigStore, error)

func (*MemoryConfigStore) GetConfig added in v0.0.5

func (s *MemoryConfigStore) GetConfig(key string) (*prefabProto.Config, bool)

func (*MemoryConfigStore) GetContextValue added in v0.0.5

func (s *MemoryConfigStore) GetContextValue(_ string) (interface{}, bool)

func (*MemoryConfigStore) GetProjectEnvID added in v0.0.5

func (s *MemoryConfigStore) GetProjectEnvID() int64

func (*MemoryConfigStore) Keys added in v0.0.5

func (s *MemoryConfigStore) Keys() []string

Jump to

Keyboard shortcuts

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