flagshiptesting

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockFeatureStore

type MockFeatureStore map[string]bool

MockFeatureStore is used for testing feature flags. It conforms to both BoolFeatureStore and ThrottleFeatureStore.

m := MockFeatureStore{
	"featureA":true,
}
m.Bool(context.Background(), "featureA") // true
m.Bool(context.Background(), "featureB") // false
m.ThrottleHash(context.Background(), "featureA", strings.NewReader("")) // true
m.ThrottleHash(context.Background(), "featureB", strings.NewReader("")) // false

func (MockFeatureStore) AllBools added in v0.0.9

func (s MockFeatureStore) AllBools(_ context.Context) map[string]bool

func (MockFeatureStore) Bool

func (s MockFeatureStore) Bool(_ context.Context, key string) bool

func (MockFeatureStore) GetHash

func (MockFeatureStore) GetHash(_ context.Context, _ string, _ io.Reader) uint

func (MockFeatureStore) ThrottleAllow

func (s MockFeatureStore) ThrottleAllow(_ context.Context, key string, _ io.Reader) bool

Jump to

Keyboard shortcuts

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