Documentation ¶
Index ¶
- type MockFeatureStore
- func (s MockFeatureStore) AllBools(_ context.Context) map[string]bool
- func (s MockFeatureStore) Bool(_ context.Context, key string) bool
- func (MockFeatureStore) GetHash(_ context.Context, _ string, _ io.Reader) uint
- func (s MockFeatureStore) ThrottleAllow(_ context.Context, key string, _ io.Reader) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockFeatureStore ¶
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) ThrottleAllow ¶
Click to show internal directories.
Click to hide internal directories.