models

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NUMERIC string = "NUMERIC"
	STRING  string = "STRING"
	BOOLEAN string = "BOOLEAN"
)

Functions

func SetCache

func SetCache(featureMap map[string]Feature, propertyMap map[string]Property, segmentMap map[string]Segment)

Types

type Cache

type Cache struct {
	FeatureMap  map[string]Feature
	PropertyMap map[string]Property
	SegmentMap  map[string]Segment
}
var CacheInstance *Cache

func GetCacheInstance

func GetCacheInstance() *Cache

type Collection

type Collection struct {
	Name          string `json:"name"`
	Collection_id string `json:"collection_id"`
}

type ConfigResponse

type ConfigResponse struct {
	Features   []Feature
	Properties []Property
	Collection Collection
	Segments   []Segment
}

type Feature

type Feature struct {
	Name           string        `json:"name"`
	Feature_id     string        `json:"feature_id"`
	DataType       string        `json:"type"`
	Enabled_value  interface{}   `json:"enabled_value"`
	Disabled_value interface{}   `json:"disabled_value"`
	Segment_rules  []SegmentRule `json:"segment_rules"`
	Enabled        bool          `json:"isEnabled"`
}

func (*Feature) GetCurrentValue

func (f *Feature) GetCurrentValue(id string, identity map[string]interface{}) interface{}

func (*Feature) GetDisabledValue

func (f *Feature) GetDisabledValue() interface{}

func (*Feature) GetEnabledValue

func (f *Feature) GetEnabledValue() interface{}

func (*Feature) GetFeatureDataType

func (f *Feature) GetFeatureDataType() string

func (*Feature) GetFeatureId

func (f *Feature) GetFeatureId() string

func (*Feature) GetFeatureName

func (f *Feature) GetFeatureName() string

func (*Feature) GetSegmentRules

func (f *Feature) GetSegmentRules() []SegmentRule

func (*Feature) IsEnabled

func (f *Feature) IsEnabled() bool

type Property

type Property struct {
	Name          string        `json:"name"`
	Property_id   string        `json:"property_id"`
	DataType      string        `json:"type"`
	Value         interface{}   `json:"value"`
	Segment_rules []SegmentRule `json:"segment_rules"`
}

func (*Property) GetCurrentValue

func (f *Property) GetCurrentValue(id string, identity map[string]interface{}) interface{}

func (*Property) GetPropertyDataType

func (f *Property) GetPropertyDataType() string

func (*Property) GetPropertyId

func (f *Property) GetPropertyId() string

func (*Property) GetPropertyName

func (f *Property) GetPropertyName() string

func (*Property) GetSegmentRules

func (f *Property) GetSegmentRules() []SegmentRule

func (*Property) GetValue

func (f *Property) GetValue() interface{}

type Rule

type Rule struct {
	Values         []interface{} `json:"values"`
	Operator       string
	Attribute_Name string
}

func (*Rule) EvaluateRule

func (r *Rule) EvaluateRule(identity map[string]interface{}) bool

func (*Rule) GetAttributeName

func (r *Rule) GetAttributeName() string

func (*Rule) GetOperator

func (r *Rule) GetOperator() string

func (*Rule) GetValues

func (r *Rule) GetValues() []interface{}

type RuleElem

type RuleElem struct {
	Segments []string
}

type Segment

type Segment struct {
	Name       string `json:"name"`
	Segment_id string `json:"segment_id"`
	Rules      []Rule `json:"rules"`
}

func (*Segment) EvaluateRule

func (s *Segment) EvaluateRule(identity map[string]interface{}) bool

func (*Segment) GetName

func (s *Segment) GetName() string

func (*Segment) GetRules

func (s *Segment) GetRules() []Rule

func (*Segment) GetSegmentId

func (s *Segment) GetSegmentId() string

type SegmentRule

type SegmentRule struct {
	Rules []RuleElem
	Value interface{}
	Order int
}

func (*SegmentRule) GetOrder

func (sr *SegmentRule) GetOrder() int

func (*SegmentRule) GetRules

func (sr *SegmentRule) GetRules() []RuleElem

func (*SegmentRule) GetValue

func (sr *SegmentRule) GetValue() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL