store

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	Flags          map[string]model.Flag `json:"flags"`
	FlagSources    []string
	SourceMetadata map[string]SourceDetails
	// contains filtered or unexported fields
}

func NewFlags

func NewFlags() *Flags

func (*Flags) Add

func (f *Flags) Add(logger *logger.Logger, source string, flags map[string]model.Flag) map[string]interface{}

Add new flags from source.

func (*Flags) Delete

func (f *Flags) Delete(key string)

func (*Flags) DeleteFlags

func (f *Flags) DeleteFlags(logger *logger.Logger, source string, flags map[string]model.Flag) map[string]interface{}

DeleteFlags matching flags from source.

func (*Flags) Get

func (f *Flags) Get(_ context.Context, key string) (model.Flag, bool)

func (*Flags) GetAll

func (f *Flags) GetAll(_ context.Context) map[string]model.Flag

GetAll returns a copy of the store's state (copy in order to be concurrency safe)

func (*Flags) Merge

func (f *Flags) Merge(
	logger *logger.Logger,
	source string,
	flags map[string]model.Flag,
) (map[string]interface{}, bool)

Merge provided flags from source with currently stored flags.

func (*Flags) SelectorForFlag added in v0.6.2

func (f *Flags) SelectorForFlag(_ context.Context, flag model.Flag) string

func (*Flags) Set

func (f *Flags) Set(key string, flag model.Flag)

func (*Flags) String

func (f *Flags) String() (string, error)

func (*Flags) Update

func (f *Flags) Update(logger *logger.Logger, source string, flags map[string]model.Flag) map[string]interface{}

Update existing flags from source.

type IStore added in v0.9.0

type IStore interface {
	GetAll(ctx context.Context) map[string]model.Flag
	Get(ctx context.Context, key string) (model.Flag, bool)
	SelectorForFlag(ctx context.Context, flag model.Flag) string
}

type SourceDetails added in v0.6.2

type SourceDetails struct {
	Source   string
	Selector string
}

Jump to

Keyboard shortcuts

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