Documentation ¶
Index ¶
- Constants
- type AllKeysMatcher
- type BetweenMatcher
- type BooleanMatcher
- type ContainsAllOfSetMatcher
- type ContainsAnyOfSetMatcher
- type ContainsStringMatcher
- type DependencyMatcher
- type EndsWithMatcher
- type EqualToMatcher
- type EqualToSetMatcher
- type GreaterThanOrEqualToMatcher
- type InSegmentMatcher
- type LessThanOrEqualToMatcher
- type Matcher
- type MatcherInterface
- type PartOfSetMatcher
- type RegexMatcher
- type StartsWithMatcher
- type WhitelistMatcher
Constants ¶
const ( // MatcherTypeAllKeys string value MatcherTypeAllKeys = "ALL_KEYS" // MatcherTypeInSegment string value MatcherTypeInSegment = "IN_SEGMENT" // MatcherTypeWhitelist string value MatcherTypeWhitelist = "WHITELIST" // MatcherTypeEqualTo string value MatcherTypeEqualTo = "EQUAL_TO" // MatcherTypeGreaterThanOrEqualTo string value MatcherTypeGreaterThanOrEqualTo = "GREATER_THAN_OR_EQUAL_TO" // MatcherTypeLessThanOrEqualTo string value MatcherTypeLessThanOrEqualTo = "LESS_THAN_OR_EQUAL_TO" // MatcherTypeBetween string value MatcherTypeBetween = "BETWEEN" // MatcherTypeEqualToSet string value MatcherTypeEqualToSet = "EQUAL_TO_SET" // MatcherTypePartOfSet string value MatcherTypePartOfSet = "PART_OF_SET" // MatcherTypeContainsAllOfSet string value MatcherTypeContainsAllOfSet = "CONTAINS_ALL_OF_SET" // MatcherTypeContainsAnyOfSet string value MatcherTypeContainsAnyOfSet = "CONTAINS_ANY_OF_SET" // MatcherTypeStartsWith string value MatcherTypeStartsWith = "STARTS_WITH" // MatcherTypeEndsWith string value MatcherTypeEndsWith = "ENDS_WITH" // MatcherTypeContainsString string value MatcherTypeContainsString = "CONTAINS_STRING" // MatcherTypeInSplitTreatment string value MatcherTypeInSplitTreatment = "IN_SPLIT_TREATMENT" // MatcherTypeEqualToBoolean string value MatcherTypeEqualToBoolean = "EQUAL_TO_BOOLEAN" // MatcherTypeMatchesString string value MatcherTypeMatchesString = "MATCHES_STRING" )
Variables ¶
This section is empty.
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 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 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) *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 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 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) *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 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
func BuildMatcher ¶
func BuildMatcher(dto *dtos.MatcherDTO, ctx *injection.Context, logger logging.LoggerInterface) (MatcherInterface, error)
BuildMatcher constructs the appropriate matcher based on the MatcherType attribute of the dto
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 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 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