featureflag

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Enabled(key, userID string) bool
	Variation(key, defaultVal, userID string) string
}

func NewClient

func NewClient(cfg *Config, logger logrus.FieldLogger) (Client, error)

type Config

type Config struct {
	Key            string
	RequestTimeout time.Duration `mapstructure:"request_timeout" split_words:"true" default:"5s"`
	Enabled        bool          `default:"false"`
}

type MockClient

type MockClient struct {
	BoolVars   map[string]bool
	StringVars map[string]string
}

func (MockClient) Enabled

func (c MockClient) Enabled(key, _ string) bool

func (MockClient) Variation

func (c MockClient) Variation(key, defaultVal, _ string) string

Jump to

Keyboard shortcuts

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