Help us shape the future of Go! Take the 2026 Go Developer Survey

stores

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package stores provides feature flag storage implementations.

Index

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.

Jump to

Keyboard shortcuts

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