Documentation
¶
Index ¶
- Constants
- Variables
- type AllKeysMatcher
- type BetweenMatcher
- type BetweenSemverMatcher
- type BooleanMatcher
- 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 InSegmentMatcher
- type LessThanOrEqualToMatcher
- type LessThanOrEqualToSemverMatcher
- 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" // MatcherEqualToSemver string value MatcherEqualToSemver = "EQUAL_TO_SEMVER" // MatcherTypeGreaterThanOrEqualToSemver string value MatcherTypeGreaterThanOrEqualToSemver = "GREATER_THAN_OR_EQUAL_TO_SEMVER" // MatcherTypeLessThanOrEqualToSemver string value MatcherTypeLessThanOrEqualToSemver = "LESS_THAN_OR_EQUAL_TO_SEMVER" // MatcherTypeBetweenSemver string value MatcherTypeBetweenSemver = "BETWEEN_SEMVER" // MatcherTypeInListSemver string value MatcherTypeInListSemver = "IN_LIST_SEMVER" // MatcherInLargeSegment string value MatcherTypeInLargeSegment = "IN_LARGE_SEGMENT" )
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 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 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 ¶ added in v6.0.2
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 ¶ added in v6.0.2
func NewInLargeSegmentMatcher(negate bool, name string, attributeName *string) *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 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 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 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