Documentation ¶
Index ¶
- func Hash(s string) uint32
- type DiffCache
- type DiffUpdated
- type Experimentation
- type Flag
- type FlagData
- func (f *FlagData) GetDefault() interface{}
- func (f *FlagData) GetDisable() bool
- func (f *FlagData) GetFalse() interface{}
- func (f *FlagData) GetPercentage() float64
- func (f *FlagData) GetRollout() *Rollout
- func (f *FlagData) GetRule() string
- func (f *FlagData) GetTrackEvents() bool
- func (f *FlagData) GetTrue() interface{}
- func (f FlagData) String() string
- func (f *FlagData) Value(flagName string, user ffuser.User) (interface{}, VariationType)
- type Progressive
- type ProgressivePercentage
- type ProgressiveReleaseRamp
- type Rollout
- type VariationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DiffCache ¶
type DiffCache struct { Deleted map[string]Flag `json:"deleted"` Added map[string]Flag `json:"added"` Updated map[string]DiffUpdated `json:"updated"` }
DiffCache contains the changes made in the cache, to be able to notify the user that something has changed (logs, webhook ...)
type DiffUpdated ¶
type Experimentation ¶ added in v0.13.0
type Experimentation struct { // Start is the starting time of the experimentation Start *time.Time `json:"start,omitempty" yaml:"start,omitempty" toml:"start,omitempty"` // End is the ending time of the experimentation End *time.Time `json:"end,omitempty" yaml:"end,omitempty" toml:"end,omitempty"` }
func (Experimentation) String ¶ added in v0.13.0
func (e Experimentation) String() string
type Flag ¶
type Flag interface { // Value is returning the Value associate to the flag (True / False / Default ) based // if the flag apply to the user or not. Value(flagName string, user ffuser.User) (interface{}, VariationType) // String display correctly a flag with the right formatting String() string // GetRule is the getter of the field Rule // Default: empty string GetRule() string // GetPercentage is the getter of the field Rule // Default: 0.0 GetPercentage() float64 // GetTrue is the getter of the field True // Default: nil GetTrue() interface{} // GetFalse is the getter of the field False // Default: nil GetFalse() interface{} // GetDefault is the getter of the field Default // Default: nil GetDefault() interface{} // GetTrackEvents is the getter of the field TrackEvents // Default: true GetTrackEvents() bool // GetDisable is the getter of the field Disable // Default: false GetDisable() bool // GetRollout is the getter of the field Rollout // Default: nil GetRollout() *Rollout }
type FlagData ¶ added in v0.14.2
type FlagData struct { // Rule is the query use to select on which user the flag should apply. // Rule format is based on the nikunjy/rules module. // If no rule set, the flag apply to all users (percentage still apply). Rule *string `json:"rule,omitempty" yaml:"rule,omitempty" toml:"rule,omitempty" slack_short:"false"` // Percentage of the users affect by the flag. // Default value is 0 Percentage *float64 `json:"percentage,omitempty" yaml:"percentage,omitempty" toml:"percentage,omitempty"` // True is the value return by the flag if apply to the user (rule is evaluated to true) // and user is in the active percentage. True *interface{} `json:"true,omitempty" yaml:"true,omitempty" toml:"true,omitempty"` // False is the value return by the flag if apply to the user (rule is evaluated to true) // and user is not in the active percentage. False *interface{} `json:"false,omitempty" yaml:"false,omitempty" toml:"false,omitempty"` // Default is the value return by the flag if not apply to the user (rule is evaluated to false). Default *interface{} `json:"default,omitempty" yaml:"default,omitempty" toml:"default,omitempty"` // TrackEvents is false if you don't want to export the data in your data exporter. // Default value is true TrackEvents *bool `json:"trackEvents,omitempty" yaml:"trackEvents,omitempty" toml:"trackEvents,omitempty"` // Disable is true if the flag is disabled. Disable *bool `json:"disable,omitempty" yaml:"disable,omitempty" toml:"disable,omitempty"` // Rollout is the object to configure how the flag is rollout. // You have different rollout strategy available but only one is used at a time. Rollout *Rollout `json:"rollout,omitempty" yaml:"rollout,omitempty" toml:"rollout,omitempty" slack_short:"false"` // nolint: lll }
FlagData describe the fields of a flag.
func (*FlagData) GetDefault ¶ added in v0.14.2
func (f *FlagData) GetDefault() interface{}
GetDefault is the getter of the field Default
func (*FlagData) GetDisable ¶ added in v0.14.2
GetDisable is the getter of the field Disable
func (*FlagData) GetFalse ¶ added in v0.14.2
func (f *FlagData) GetFalse() interface{}
GetFalse is the getter of the field False
func (*FlagData) GetPercentage ¶ added in v0.14.2
GetPercentage is the getter of the field Percentage
func (*FlagData) GetRollout ¶ added in v0.14.2
GetRollout is the getter of the field Rollout
func (*FlagData) GetTrackEvents ¶ added in v0.14.2
GetTrackEvents is the getter of the field TrackEvents
func (*FlagData) GetTrue ¶ added in v0.14.2
func (f *FlagData) GetTrue() interface{}
GetTrue is the getter of the field True
type Progressive ¶ added in v0.14.0
type Progressive struct { // Percentage is where you can configure at what percentage your progressive rollout start // and at what percentage it ends. // This field is optional Percentage ProgressivePercentage `json:"percentage,omitempty" yaml:"percentage,omitempty" toml:"percentage,omitempty"` // ReleaseRamp is the defining when the progressive rollout starts and ends. // This field is mandatory if you want to use a progressive rollout. // If any field missing we ignore the progressive rollout. ReleaseRamp ProgressiveReleaseRamp `json:"releaseRamp,omitempty" yaml:"releaseRamp,omitempty" toml:"releaseRamp,omitempty"` // nolint: lll }
Progressive is the configuration struct to define a progressive rollout.
type ProgressivePercentage ¶ added in v0.14.0
type ProgressivePercentage struct { // Initial is the initial percentage before the rollout start date. // This field is optional // Default: 0.0 Initial float64 `json:"initial,omitempty" yaml:"initial,omitempty" toml:"initial,omitempty"` // End is the target percentage we want to reach at the end of the rollout phase. // This field is optional // Default: 100.0 End float64 `json:"end,omitempty" yaml:"end,omitempty" toml:"end,omitempty"` }
type ProgressiveReleaseRamp ¶ added in v0.14.0
type Rollout ¶ added in v0.13.1
type Rollout struct { // Experimentation is your struct to configure an experimentation, it will allow you to configure a start date and // an end date for your flag. // When the experimentation is not running, the flag will serve the default value. Experimentation *Experimentation `json:"experimentation,omitempty" yaml:"experimentation,omitempty" toml:"experimentation,omitempty" slack_short:"false"` // nolint: lll // Progressive is your struct to configure a progressive rollout deployment of your flag. // It will allow you to ramp up the percentage of your flag over time. // You can decide at which percentage you starts and at what percentage you ends in your release ramp. // Before the start date we will serve the initial percentage and after we will serve the end percentage. Progressive *Progressive `json:"progressive,omitempty" yaml:"progressive,omitempty" toml:"progressive,omitempty" slack_short:"false"` // nolint: lll }
type VariationType ¶ added in v0.10.0
type VariationType string
VariationType enum which describe the decision taken
const ( VariationTrue VariationType = "True" VariationFalse VariationType = "False" VariationDefault VariationType = "Default" VariationSDKDefault VariationType = "SdkDefault" )
Click to show internal directories.
Click to hide internal directories.