Documentation
¶
Overview ¶
Package stores provides feature flag storage implementations.
Index ¶
- Variables
- type MemoryStore
- func (s *MemoryStore) Delete(ctx context.Context, key string) error
- func (s *MemoryStore) Get(ctx context.Context, key string) (*featureflags.Flag, error)
- func (s *MemoryStore) GetAll(ctx context.Context) ([]*featureflags.Flag, error)
- func (s *MemoryStore) Preload(flags []*featureflags.Flag)
- func (s *MemoryStore) Set(ctx context.Context, flag *featureflags.Flag) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFlagNotFound = errors.New("flag not found")
ErrFlagNotFound is returned when a flag is not found.
Functions ¶
This section is empty.
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is an in-memory feature flag store. Suitable for development or single-instance deployments.
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore creates a new in-memory flag store.
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(ctx context.Context, key string) error
Delete removes a flag.
func (*MemoryStore) Get ¶
func (s *MemoryStore) Get(ctx context.Context, key string) (*featureflags.Flag, error)
Get retrieves a flag by key.
func (*MemoryStore) GetAll ¶
func (s *MemoryStore) GetAll(ctx context.Context) ([]*featureflags.Flag, error)
GetAll retrieves all flags.
func (*MemoryStore) Preload ¶
func (s *MemoryStore) Preload(flags []*featureflags.Flag)
Preload loads initial flags into the store.
func (*MemoryStore) Set ¶
func (s *MemoryStore) Set(ctx context.Context, flag *featureflags.Flag) error
Set creates or updates a flag.
Click to show internal directories.
Click to hide internal directories.