Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureFlag ¶
FeatureFlag represents a feature flag with an identifier and a value
func NewFeatureFlag ¶
func NewFeatureFlag(id string, value float64) (*FeatureFlag, error)
NewFeatureFlag returns a new feature flag
func (*FeatureFlag) IsEnabled ¶
func (ff *FeatureFlag) IsEnabled() bool
IsEnabled returns true with probability equal to the value of the flag.
func (*FeatureFlag) IsEnabledForUser ¶
func (ff *FeatureFlag) IsEnabledForUser(userID string) bool
IsEnabledForUser returns true if the treatment represented by this flag should be applied for a given user identifier. If the flag's value does not change, this will always return the same result for any given user identifier.
type FlagStorage ¶
type FlagStorage interface { GetFlag(id string) (*FeatureFlag, error) PutFlag(ff *FeatureFlag) error DeleteFlag(id string) error }
FlagStorage represents the required functionality of a storage solution for feature flags.
Click to show internal directories.
Click to hide internal directories.