Documentation
¶
Index ¶
- Constants
- type Experimentation
- type FlagData
- func (f *FlagData) GetDefaultVariation() string
- func (f *FlagData) GetMetadata() map[string]interface{}
- func (f *FlagData) GetRawValues() map[string]string
- func (f *FlagData) GetVariationValue(variationName string) interface{}
- func (f *FlagData) GetVersion() string
- func (f *FlagData) IsDisable() bool
- func (f *FlagData) IsTrackEvents() bool
- func (f FlagData) String() string
- func (f *FlagData) Value(flagName string, user ffcontext.Context, evaluationCtx flag.Context) (interface{}, flag.ResolutionDetails)
- type Progressive
- type ProgressivePercentage
- type ProgressiveReleaseRamp
- type Rollout
- type ScheduledRollout
- type ScheduledStep
Constants ¶
View Source
const ( // VariationTrue is a constant to explain that we are using the "True" variation VariationTrue string = "True" // VariationFalse is a constant to explain that we are using the "False" variation VariationFalse string = "False" // VariationDefault is a constant to explain that we are using the "Default" variation VariationDefault string = "Default" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Experimentation ¶
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 ¶
func (e Experimentation) String() string
type FlagData ¶
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"`
// 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"`
// Version (optional) This field contains the version of the flag.
// The version is manually managed when you configure your flags and it is used to display the information
// in the notifications and data collection.
Version *float64 `json:"version,omitempty" yaml:"version,omitempty" toml:"version,omitempty"`
}
FlagData describe the fields of a flag.
func ConvertDtoToV1 ¶
func (*FlagData) GetDefaultVariation ¶
func (*FlagData) GetMetadata ¶ added in v1.11.0
func (*FlagData) GetRawValues ¶
func (*FlagData) GetVariationValue ¶
GetVariationValue return the value of variation from his name
func (*FlagData) GetVersion ¶
GetVersion is the getter for the field Version
func (*FlagData) IsTrackEvents ¶
IsTrackEvents is the getter of the field TrackEvents
type Progressive ¶
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 ¶
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 ¶
type Rollout ¶
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"` // 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"` // nolint: lll
// Scheduled is your struct to configure an update on some fields of your flag over time.
// You can add several steps that updates the flag, this is typically used if you want to gradually add more user
// in your flag.
Scheduled *ScheduledRollout `json:"scheduled,omitempty" yaml:"scheduled,omitempty" toml:"scheduled,omitempty"` // nolint: lll
}
type ScheduledRollout ¶
type ScheduledRollout struct {
// Steps is the list of updates to do in a specific date.
Steps []ScheduledStep `json:"steps,omitempty" yaml:"steps,omitempty" toml:"steps,omitempty"`
}
type ScheduledStep ¶
Click to show internal directories.
Click to hide internal directories.