Documentation
¶
Index ¶
- func IsValidDataType(category string) bool
- func SetCache(featureMap map[string]Feature, propertyMap map[string]Property, ...)
- type Cache
- type Collection
- type ConfigResponse
- type Feature
- func (f *Feature) GetCurrentValue(entityID string, entityAttributes ...map[string]interface{}) interface{}
- func (f *Feature) GetDisabledValue() interface{}
- func (f *Feature) GetEnabledValue() interface{}
- func (f *Feature) GetFeatureDataFormat() string
- func (f *Feature) GetFeatureDataType() string
- func (f *Feature) GetFeatureID() string
- func (f *Feature) GetFeatureName() string
- func (f *Feature) GetRolloutPercentage() int
- func (f *Feature) GetSegmentRules() []SegmentRule
- func (f *Feature) IsEnabled() bool
- type Property
- func (p *Property) GetCurrentValue(entityID string, entityAttributes ...map[string]interface{}) interface{}
- func (p *Property) GetPropertyDataFormat() string
- func (p *Property) GetPropertyDataType() string
- func (p *Property) GetPropertyID() string
- func (p *Property) GetPropertyName() string
- func (p *Property) GetSegmentRules() []SegmentRule
- func (p *Property) GetValue() interface{}
- type Rule
- type RuleElem
- type Segment
- type SegmentRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidDataType ¶ added in v0.2.0
Types ¶
type Cache ¶
type Cache struct {
FeatureMap map[string]Feature
PropertyMap map[string]Property
SegmentMap map[string]Segment
}
Cache : Cache struct
var CacheInstance *Cache
CacheInstance : Cache Instance
type Collection ¶
Collection : Collection struct
type ConfigResponse ¶
type ConfigResponse struct {
Features []Feature
Properties []Property
Collection Collection
Segments []Segment
}
ConfigResponse : ConfigResponse struct
type Feature ¶
type Feature struct {
Name string `json:"name"`
FeatureID string `json:"feature_id"`
DataType string `json:"type"`
Format string `json:"format"`
EnabledValue interface{} `json:"enabled_value"`
DisabledValue interface{} `json:"disabled_value"`
SegmentRules []SegmentRule `json:"segment_rules"`
Enabled bool `json:"enabled"`
RolloutPercentage *int `json:"rollout_percentage"`
}
Feature : Feature struct
func (*Feature) GetCurrentValue ¶
func (f *Feature) GetCurrentValue(entityID string, entityAttributes ...map[string]interface{}) interface{}
GetCurrentValue returns one of the Enabled/Disabled/Overridden value based on the evaluation.
The function takes in entityId & entityAttributes parameters.
entityId is a string identifier related to the Entity against which the feature will be evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that runs on the cloud, or a component of infrastructure that runs that microservice. For any entity to interact with App Configuration, it must provide a unique entity ID.
entityAttributes is a map of type `map[string]interface{}` consisting of the attribute name and their values that defines the specified entity. This is an optional parameter if the feature flag is not configured with any targeting definition. If the targeting is configured, then entityAttributes should be provided for the rule evaluation. An attribute is a parameter that is used to define a segment. The SDK uses the attribute values to determine if the specified entity satisfies the targeting rules, and returns the appropriate feature flag value.
func (*Feature) GetDisabledValue ¶
func (f *Feature) GetDisabledValue() interface{}
GetDisabledValue : Get Disabled Value
func (*Feature) GetEnabledValue ¶
func (f *Feature) GetEnabledValue() interface{}
GetEnabledValue : Get Enabled Value
func (*Feature) GetFeatureDataFormat ¶ added in v0.2.0
GetFeatureDataFormat : Get Feature Data Format
func (*Feature) GetFeatureDataType ¶
GetFeatureDataType : Get Feature Data Type
func (*Feature) GetFeatureID ¶ added in v0.1.1
GetFeatureID : Get Feature ID
func (*Feature) GetFeatureName ¶
GetFeatureName : Get Feature Name
func (*Feature) GetRolloutPercentage ¶ added in v0.3.0
GetRolloutPercentage : Get the Feature flag rollout percentage
func (*Feature) GetSegmentRules ¶
func (f *Feature) GetSegmentRules() []SegmentRule
GetSegmentRules : Get Segment Rules
type Property ¶
type Property struct {
Name string `json:"name"`
PropertyID string `json:"property_id"`
DataType string `json:"type"`
Format string `json:"format"`
Value interface{} `json:"value"`
SegmentRules []SegmentRule `json:"segment_rules"`
}
Property : Property struct
func (*Property) GetCurrentValue ¶
func (p *Property) GetCurrentValue(entityID string, entityAttributes ...map[string]interface{}) interface{}
GetCurrentValue returns the default property value or its overridden value based on the evaluation.
The function takes in entityId & entityAttributes parameters.
entityId is a string identifier related to the Entity against which the property will be evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that runs on the cloud, or a component of infrastructure that runs that microservice. For any entity to interact with App Configuration, it must provide a unique entity ID.
entityAttributes is a map of type `map[string]interface{}` consisting of the attribute name and their values that defines the specified entity. This is an optional parameter if the property is not configured with any targeting definition. If the targeting is configured, then entityAttributes should be provided for the rule evaluation. An attribute is a parameter that is used to define a segment. The SDK uses the attribute values to determine if the specified entity satisfies the targeting rules, and returns the appropriate property value.
func (*Property) GetPropertyDataFormat ¶ added in v0.2.0
GetPropertyDataFormat : Get Property Data Format
func (*Property) GetPropertyDataType ¶
GetPropertyDataType : Get Property Data Type
func (*Property) GetPropertyID ¶ added in v0.1.1
GetPropertyID : Get Property Id
func (*Property) GetPropertyName ¶
GetPropertyName : Get Property Name
func (*Property) GetSegmentRules ¶
func (p *Property) GetSegmentRules() []SegmentRule
GetSegmentRules : Get Segment Rules
type Rule ¶
type Rule struct {
Values []interface{} `json:"values"`
Operator string
AttributeName string `json:"Attribute_Name"`
}
Rule : Rule struct
func (*Rule) EvaluateRule ¶
EvaluateRule : Evaluate Rule
func (*Rule) GetAttributeName ¶
GetAttributeName : Get Attribute Name
type Segment ¶
type Segment struct {
Name string `json:"name"`
SegmentID string `json:"segment_id"`
Rules []Rule `json:"rules"`
}
Segment : Segment struct
func (*Segment) EvaluateRule ¶
EvaluateRule : Evaluate Rule
func (*Segment) GetSegmentID ¶ added in v0.1.1
GetSegmentID : Get SegmentID
type SegmentRule ¶
type SegmentRule struct {
Rules []RuleElem
Value interface{}
Order int
RolloutPercentage *interface{} `json:"rollout_percentage"`
}
SegmentRule : SegmentRule struct
func (*SegmentRule) GetRolloutPercentage ¶ added in v0.3.0
func (sr *SegmentRule) GetRolloutPercentage() interface{}
GetRolloutPercentage : Get the rollout percentage of the segment rule