Documentation
¶
Index ¶
- Constants
- Variables
- type AllKeysMatcher
- type BetweenMatcher
- type BetweenSemverMatcher
- type BooleanMatcher
- type Condition
- func BuildCondition(conditionType string, label string, partitions []Partition, ...) *Condition
- func NewCondition(cond *dtos.ConditionDTO, logger logging.LoggerInterface, ...) (*Condition, error)
- func NewRBCondition(cond *dtos.RuleBasedConditionDTO, logger logging.LoggerInterface, ...) (*Condition, error)
- type ContainsAllOfSetMatcher
- type ContainsAnyOfSetMatcher
- type ContainsStringMatcher
- type DependencyMatcher
- type EndsWithMatcher
- type EqualToMatcher
- type EqualToSemverMatcher
- type EqualToSetMatcher
- type GreaterThanOrEqualToMatcher
- type GreaterThanOrEqualToSemverMatcher
- type InLargeSegmentMatcher
- type InListSemverMatcher
- type InRuleBasedSegmentMatcher
- type InSegmentMatcher
- type LessThanOrEqualToMatcher
- type LessThanOrEqualToSemverMatcher
- type Matcher
- type MatcherInterface
- type PartOfSetMatcher
- type Partition
- type PrerequisitesMatcher
- type RegexMatcher
- type RuleBuilder
- type Split
- func (s *Split) Algo() int
- func (s *Split) ChangeNumber() int64
- func (s *Split) Conditions() []*Condition
- func (s *Split) Configurations() map[string]string
- func (s *Split) DefaultTreatment() string
- func (s *Split) ImpressionsDisabled() bool
- func (s *Split) Killed() bool
- func (s *Split) Name() string
- func (s *Split) Prerequisites() *PrerequisitesMatcher
- func (s *Split) Seed() int64
- func (s *Split) Status() string
- func (s *Split) TrafficAllocation() int
- func (s *Split) TrafficAllocationSeed() int64
- type StartsWithMatcher
- type WhitelistMatcher
Constants ¶
const ( // ConditionTypeWhitelist represents a normal condition ConditionTypeWhitelist = "WHITELIST" // ConditionTypeRollout represents a condition that will return default if traffic allocatio is exceeded ConditionTypeRollout = "ROLLOUT" // MatcherCombinerAnd represents that all matchers in the group are required MatcherCombinerAnd = 0 )
Variables ¶
var ErrInvalidEqualSemver = errors.New("semver is required for EQUAL_TO_SEMVER matcher type")
var ErrInvalidGTOESemver = errors.New("semver is required for GREATER_THAN_OR_EQUAL_TO_SEMVER matcher type")
var ErrInvalidLBetweenSemver = errors.New("semver is required for BETWEEN_SEMVER matcher type")
var ErrInvalidLInListSemver = errors.New("semver is required for IN_LIST_SEMVER matcher type")
var ErrInvalidLTOESemver = errors.New("semver is required for LESS_THAN_OR_EQUAL_TO_SEMVER matcher type")
Functions ¶
This section is empty.
Types ¶
type AllKeysMatcher ¶
type AllKeysMatcher struct {
Matcher
}
AllKeysMatcher matches any given key and set of attributes
func NewAllKeysMatcher ¶
func NewAllKeysMatcher(negate bool) *AllKeysMatcher
NewAllKeysMatcher returns a pointer to a new instance of AllKeysMatcher
type BetweenMatcher ¶
type BetweenMatcher struct {
Matcher
ComparisonDataType string
LowerComparisonValue int64
UpperComparisonValue int64
}
BetweenMatcher will match if two numbers or two datetimes are equal
func NewBetweenMatcher ¶
func NewBetweenMatcher(negate bool, lower int64, upper int64, cmpType string, attributeName *string) *BetweenMatcher
NewBetweenMatcher returns a pointer to a new instance of BetweenMatcher
type BetweenSemverMatcher ¶
type BetweenSemverMatcher struct {
Matcher
// contains filtered or unexported fields
}
BetweenSemverMatcher struct to hold the semver to compare
func NewBetweenSemverMatcher ¶
func NewBetweenSemverMatcher(startVal string, endVal string, negate bool, attributeName *string, logger logging.LoggerInterface) *BetweenSemverMatcher
NewBetweenSemverMatcher returns a pointer to a new instance of BetweenSemverMatcher
type BooleanMatcher ¶
type BooleanMatcher struct {
Matcher
// contains filtered or unexported fields
}
BooleanMatcher returns true if the value supplied can be interpreted as a boolean and is equal to the one stored
func NewBooleanMatcher ¶
func NewBooleanMatcher(negate bool, value *bool, attributeName *string) *BooleanMatcher
NewBooleanMatcher instantiates a new BooleanMatcher
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
Condition struct with added logic that wraps around a DTO
func BuildCondition ¶
func NewCondition ¶
func NewCondition(cond *dtos.ConditionDTO, logger logging.LoggerInterface, ruleBuilder RuleBuilder) (*Condition, error)
NewCondition instantiates a new Condition struct with appropriate wrappers around dtos and returns it.
func NewRBCondition ¶
func NewRBCondition(cond *dtos.RuleBasedConditionDTO, logger logging.LoggerInterface, ruleBuilder RuleBuilder) (*Condition, error)
func (*Condition) CalculateTreatment ¶
CalculateTreatment calulates the treatment for a specific condition based on the bucket
func (*Condition) ConditionType ¶
ConditionType returns validated condition type. Whitelist by default
type ContainsAllOfSetMatcher ¶
type ContainsAllOfSetMatcher struct {
Matcher
// contains filtered or unexported fields
}
ContainsAllOfSetMatcher matches if the set supplied to the getTreatment is a superset of the one in the feature flag
func NewContainsAllOfSetMatcher ¶
func NewContainsAllOfSetMatcher(negate bool, setItems []string, attributeName *string) *ContainsAllOfSetMatcher
NewContainsAllOfSetMatcher returns a pointer to a new instance of ContainsAllOfSetMatcher
type ContainsAnyOfSetMatcher ¶
type ContainsAnyOfSetMatcher struct {
Matcher
// contains filtered or unexported fields
}
ContainsAnyOfSetMatcher matches if the set supplied to the getTreatment is a superset of the one in the feature flag
func NewContainsAnyOfSetMatcher ¶
func NewContainsAnyOfSetMatcher(negate bool, setItems []string, attributeName *string) *ContainsAnyOfSetMatcher
NewContainsAnyOfSetMatcher returns a pointer to a new instance of ContainsAnyOfSetMatcher
type ContainsStringMatcher ¶
type ContainsStringMatcher struct {
Matcher
// contains filtered or unexported fields
}
ContainsStringMatcher matches strings contain one of the substrings in the feature flag
func NewContainsStringMatcher ¶
func NewContainsStringMatcher(negate bool, substrings []string, attributeName *string) *ContainsStringMatcher
NewContainsStringMatcher returns a new instance of ContainsStringMatcher
type DependencyMatcher ¶
type DependencyMatcher struct {
Matcher
// contains filtered or unexported fields
}
DependencyMatcher will match if the evaluation of another split results in one of the treatments defined in the feature flag
func NewDependencyMatcher ¶
func NewDependencyMatcher(negate bool, feature string, treatments []string, deedependencyEvaluator dependencyEvaluator) *DependencyMatcher
NewDependencyMatcher will return a new instance of DependencyMatcher
type EndsWithMatcher ¶
type EndsWithMatcher struct {
Matcher
// contains filtered or unexported fields
}
EndsWithMatcher matches strings which end with one of the suffixes in the feature flag
func NewEndsWithMatcher ¶
func NewEndsWithMatcher(negate bool, suffixes []string, attributeName *string) *EndsWithMatcher
NewEndsWithMatcher returns a new instance of EndsWithMatcher
type EqualToMatcher ¶
EqualToMatcher will match if two numbers or two datetimes are equal
func NewEqualToMatcher ¶
func NewEqualToMatcher(negate bool, cmpVal int64, cmpType string, attributeName *string) *EqualToMatcher
NewEqualToMatcher returns a pointer to a new instance of EqualToMatcher
type EqualToSemverMatcher ¶
type EqualToSemverMatcher struct {
Matcher
// contains filtered or unexported fields
}
EqualToSemverMatcher struct to hold the semver to compare
func NewEqualToSemverMatcher ¶
func NewEqualToSemverMatcher(cmpVal string, negate bool, attributeName *string, logger logging.LoggerInterface) *EqualToSemverMatcher
NewEqualToSemverMatcher returns a pointer to a new instance of EqualToSemverMatcher
type EqualToSetMatcher ¶
type EqualToSetMatcher struct {
Matcher
// contains filtered or unexported fields
}
EqualToSetMatcher matches if the set supplied to the getTreatment is equal to the one in the feature flag
func NewEqualToSetMatcher ¶
func NewEqualToSetMatcher(negate bool, setItems []string, attributeName *string) *EqualToSetMatcher
NewEqualToSetMatcher returns a pointer to a new instance of EqualToSetMatcher
type GreaterThanOrEqualToMatcher ¶
GreaterThanOrEqualToMatcher will match if two numbers or two datetimes are equal
func NewGreaterThanOrEqualToMatcher ¶
func NewGreaterThanOrEqualToMatcher(negate bool, cmpVal int64, cmpType string, attributeName *string) *GreaterThanOrEqualToMatcher
NewGreaterThanOrEqualToMatcher returns a pointer to a new instance of GreaterThanOrEqualToMatcher
type GreaterThanOrEqualToSemverMatcher ¶
type GreaterThanOrEqualToSemverMatcher struct {
Matcher
// contains filtered or unexported fields
}
GreaterThanOrEqualToSemverMatcher struct to hold the semver to compare
func NewGreaterThanOrEqualToSemverMatcher ¶
func NewGreaterThanOrEqualToSemverMatcher(negate bool, compareTo string, attributeName *string, logger logging.LoggerInterface) *GreaterThanOrEqualToSemverMatcher
NewGreaterThanOrEqualToSemverMatcher returns an instance of GreaterThanOrEqualToSemverMatcher
type InLargeSegmentMatcher ¶
type InLargeSegmentMatcher struct {
Matcher
// contains filtered or unexported fields
}
InLargeSegmentMatcher matches if the key passed is in the large segment which the matcher was constructed with
func NewInLargeSegmentMatcher ¶
func NewInLargeSegmentMatcher(negate bool, name string, attributeName *string, largeSegmentStorage storage.LargeSegmentStorageConsumer) *InLargeSegmentMatcher
NewInLargeSegmentMatcher instantiates a new InLargeSegmentMatcher
type InListSemverMatcher ¶
type InListSemverMatcher struct {
Matcher
// contains filtered or unexported fields
}
InListSemverMatcher struct to hold the semver to compare
func NewInListSemverMatcher ¶
func NewInListSemverMatcher(setVersions []string, negate bool, attributeName *string, logger logging.LoggerInterface) *InListSemverMatcher
NewInListSemverMatcher returns a pointer to a new instance of InListSemverMatcher
type InRuleBasedSegmentMatcher ¶
type InRuleBasedSegmentMatcher struct {
Matcher
// contains filtered or unexported fields
}
InRuleBasedsegmentMatcher matches if the key passed is in the rule-based segment which the matcher was constructed with
func NewInRuleBasedSegmentMatcher ¶
func NewInRuleBasedSegmentMatcher(negate bool, name string, attributeName *string, ruleBuilder RuleBuilder) *InRuleBasedSegmentMatcher
NewInRuleBasedSegmentMatcher instantiates a new InRuleBasedSegmentMatcher
type InSegmentMatcher ¶
type InSegmentMatcher struct {
Matcher
// contains filtered or unexported fields
}
InSegmentMatcher matches if the key passed is in the segment which the matcher was constructed with
func NewInSegmentMatcher ¶
func NewInSegmentMatcher(negate bool, segmentName string, attributeName *string, segmentStorage storage.SegmentStorageConsumer) *InSegmentMatcher
NewInSegmentMatcher instantiates a new InSegmentMatcher
type LessThanOrEqualToMatcher ¶
LessThanOrEqualToMatcher will match if two numbers or two datetimes are equal
func NewLessThanOrEqualToMatcher ¶
func NewLessThanOrEqualToMatcher(negate bool, cmpVal int64, cmpType string, attributeName *string) *LessThanOrEqualToMatcher
NewLessThanOrEqualToMatcher returns a pointer to a new instance of LessThanOrEqualToMatcher
type LessThanOrEqualToSemverMatcher ¶
type LessThanOrEqualToSemverMatcher struct {
Matcher
// contains filtered or unexported fields
}
LessThanOrEqualToSemverMatcher struct to hold the semver to compare
func NewLessThanOrEqualToSemverMatcher ¶
func NewLessThanOrEqualToSemverMatcher(compareTo string, negate bool, attributeName *string, logger logging.LoggerInterface) *LessThanOrEqualToSemverMatcher
NewLessThanOrEqualToSemverMatcher returns a pointer to a new instance of LessThanOrEqualToSemverMatcher
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher struct with added logic that wraps around a DTO
type MatcherInterface ¶
type MatcherInterface interface {
Match(key string, attributes map[string]interface{}, bucketingKey *string) bool
Negate() bool
// contains filtered or unexported methods
}
MatcherInterface should be implemented by all matchers
type PartOfSetMatcher ¶
type PartOfSetMatcher struct {
Matcher
// contains filtered or unexported fields
}
PartOfSetMatcher matches if the set supplied to the getTreatment is a subset of the one in the feature flag
func NewPartOfSetMatcher ¶
func NewPartOfSetMatcher(negate bool, setItems []string, attributeName *string) *PartOfSetMatcher
NewPartOfSetMatcher returns a pointer to a new instance of PartOfSetMatcher
type Partition ¶
type Partition struct {
PartitionData dtos.PartitionDTO
}
Partition struct with added logic that wraps around a DTO
type PrerequisitesMatcher ¶
type PrerequisitesMatcher struct {
Matcher
// contains filtered or unexported fields
}
func NewPrerequisitesMatcher ¶
func NewPrerequisitesMatcher(prerequisistes []dtos.Prerequisite, dependencyEvaluator dependencyEvaluator) *PrerequisitesMatcher
NewPrerequisitesMatcher will return a new instance of PrerequisitesMatcher
type RegexMatcher ¶
type RegexMatcher struct {
Matcher
// contains filtered or unexported fields
}
RegexMatcher matches if the supplied key matches the feature flag's regex
func NewRegexMatcher ¶
func NewRegexMatcher(negate bool, regex string, attributeName *string) *RegexMatcher
NewRegexMatcher returns a new instance to a RegexMatcher
type RuleBuilder ¶
type RuleBuilder struct {
// contains filtered or unexported fields
}
func NewRuleBuilder ¶
func NewRuleBuilder(segmentStorage storage.SegmentStorageConsumer, ruleBasedSegmentStorage storage.RuleBasedSegmentStorageConsumer, largeSegmentStorage storage.LargeSegmentStorageConsumer, ffAcceptedMatchers []string, rbAcceptedMatchers []string, logger logging.LoggerInterface, dedependencyEvaluator dependencyEvaluator) RuleBuilder
func (RuleBuilder) BuildMatcher ¶
func (r RuleBuilder) BuildMatcher(dto *dtos.MatcherDTO) (MatcherInterface, error)
func (RuleBuilder) BuildPrerequistesMatchers ¶
func (r RuleBuilder) BuildPrerequistesMatchers(prerequistes []dtos.Prerequisite) *PrerequisitesMatcher
type Split ¶
type Split struct {
// contains filtered or unexported fields
}
Split struct with added logic that wraps around a DTO
func NewSplit ¶
func NewSplit(splitDTO *dtos.SplitDTO, logger logging.LoggerInterface, ruleBuilder RuleBuilder) *Split
NewSplit instantiates a new Split object and all it's internal structures mapped to model classes
func (*Split) ChangeNumber ¶
ChangeNumber returns the change number for this feature flag
func (*Split) Conditions ¶
Conditions returns a slice of Condition objects
func (*Split) Configurations ¶
Configurations returns the configurations for this feature flag
func (*Split) DefaultTreatment ¶
DefaultTreatment returns the default treatment for the current feature flag
func (*Split) ImpressionsDisabled ¶
func (*Split) Prerequisites ¶
func (s *Split) Prerequisites() *PrerequisitesMatcher
func (*Split) TrafficAllocation ¶
TrafficAllocation returns the traffic allocation configured for the current feature flag
func (*Split) TrafficAllocationSeed ¶
TrafficAllocationSeed returns the seed for traffic allocation configured for this feature flag
type StartsWithMatcher ¶
type StartsWithMatcher struct {
Matcher
// contains filtered or unexported fields
}
StartsWithMatcher matches strings which start with one of the prefixes in the feature flag
func NewStartsWithMatcher ¶
func NewStartsWithMatcher(negate bool, prefixes []string, attributeName *string) *StartsWithMatcher
NewStartsWithMatcher returns a new instance of StartsWithMatcher
type WhitelistMatcher ¶
type WhitelistMatcher struct {
Matcher
// contains filtered or unexported fields
}
WhitelistMatcher matches if the key received is present in the matcher's whitelist
func NewWhitelistMatcher ¶
func NewWhitelistMatcher(negate bool, whitelist []string, attributeName *string) *WhitelistMatcher
NewWhitelistMatcher returns a new WhitelistMatcher
Source Files
¶
- allkeys.go
- allofset.go
- anyofset.go
- between.go
- boolean.go
- condition.go
- constants.go
- contains.go
- dependency.go
- endswith.go
- equalto.go
- equaltoset.go
- gtoet.go
- inlargesegment.go
- inrulebasedsegment.go
- insegment.go
- ltoet.go
- matchers.go
- partofset.go
- prerequisites.go
- regex.go
- rulebuilder.go
- semver.go
- split.go
- startswith.go
- whitelist.go