Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DISABLED_VARIANT = &Variant{ Name: "disabled", Enabled: false, }
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Constraint struct { // ContextName is the context name of the constraint. ContextName string `json:"contextName"` // Operator is the operator of the constraint. Operator Operator `json:"operator"` // Values is the values of the constraint. Values []string `json:"values"` }
Constraint represents a constraint on a particular context value.
type Feature ¶
type Feature struct { // Name is the name of the feature toggle. Name string `json:"name"` // Description is a description of the feature toggle. Description string `json:"description"` // Enabled indicates whether the feature was enabled or not. Enabled bool `json:"enabled"` // Strategies is a list of names of the strategies supported by the client. Strategies []Strategy `json:"strategies"` // CreatedAt is the creation time of the feature toggle. CreatedAt time.Time `json:"createdAt"` // Strategy is the strategy of the feature toggle. Strategy string `json:"strategy"` // Parameters is the parameters of the feature toggle. Parameters ParameterMap `json:"parameters"` // Variants is a list of variants of the feature toggle. Variants []VariantInternal `json:"variants"` }
type FeatureResponse ¶
func (FeatureResponse) FeatureMap ¶
func (fr FeatureResponse) FeatureMap() map[string]interface{}
type ParameterDescription ¶
type ParameterMap ¶
type ParameterMap map[string]interface{}
type Strategy ¶
type Strategy struct { // Id is the name of the strategy. Id int `json:"id"` // Name is the name of the strategy. Name string `json:"name"` // Constraints is the constraints of the strategy. Constraints []Constraint `json:"constraints"` // Parameters is the parameters of the strategy. Parameters ParameterMap `json:"parameters"` }
type StrategyDescription ¶
type StrategyDescription struct { Name string `json:"name"` Description string `json:"description"` Parameters []ParameterDescription `json:"parameters"` }
type StrategyResponse ¶
type StrategyResponse struct { Response Strategies []StrategyDescription `json:"strategies"` }
type Variant ¶
type Variant struct { // Name is the value of the variant name. Name string `json:"name"` // Payload is the value of the variant payload Payload Payload `json:"payload"` // Enabled indicates whether the feature which is extend by this variant was enabled or not. Enabled bool `json:"enabled"` }
func GetDefaultVariant ¶
func GetDefaultVariant() *Variant
Get default variant if no variant is found
type VariantInternal ¶
type VariantInternal struct { Variant // Weight is the traffic ratio for the request Weight int `json:"weight"` // WeightType can be fixed or variable WeightType string `json:"weightType"` // Override is used to get a variant accoording to the Unleash context field Overrides []Override `json:"overrides"` }
Click to show internal directories.
Click to hide internal directories.