Documentation ¶
Overview ¶
Package configcattest provides an HTTP handler that can be used to test configcat scenarios in tests.
This API should be considered experimental for now and may change in a backwardly incompatible manner.
Package configcattest provides an HTTP handler that can be used to test configcat scenarios in tests.
Index ¶
Constants ¶
View Source
const ( OpOneOf = Operator(wireconfig.OpOneOf) OpNotOneOf = Operator(wireconfig.OpNotOneOf) OpContains = Operator(wireconfig.OpContains) OpNotContains = Operator(wireconfig.OpNotContains) OpOneOfSemver = Operator(wireconfig.OpOneOfSemver) OpNotOneOfSemver = Operator(wireconfig.OpNotOneOfSemver) OpLessSemver = Operator(wireconfig.OpLessSemver) OpLessEqSemver = Operator(wireconfig.OpLessEqSemver) OpGreaterSemver = Operator(wireconfig.OpGreaterSemver) OpGreaterEqSemver = Operator(wireconfig.OpGreaterEqSemver) OpEqNum = Operator(wireconfig.OpEqNum) OpNotEqNum = Operator(wireconfig.OpNotEqNum) OpLessNum = Operator(wireconfig.OpLessNum) OpLessEqNum = Operator(wireconfig.OpLessEqNum) OpGreaterNum = Operator(wireconfig.OpGreaterNum) OpGreaterEqNum = Operator(wireconfig.OpGreaterEqNum) OpOneOfSensitive = Operator(wireconfig.OpOneOfSensitive) OpNotOneOfSensitive = Operator(wireconfig.OpNotOneOfSensitive) )
Variables ¶
This section is empty.
Functions ¶
func RandomSDKKey ¶
func RandomSDKKey() string
RandomSDKKey returns a new randomly generated SDK key suitable for passing to SetFlags.
Types ¶
type Flag ¶
type Flag struct { // Default holds the default value for the flag. // It should hold one of the types string, float64, int or bool. Default interface{} // Rules holds a set of rules to check against in order. // If any rule is satisfied, its associated value is used, // otherwise the default value is used. Rules []Rule }
Flag represents a configcat flag.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a http.Handler that serves up configcat flags. The zero value is OK to use and has no flag configurations. Use SetFlags to add or update the set of flags served.
type Rule ¶
type Rule struct { // ComparisonAttribute holds the user attribute to // check when evaluating the rule. ComparisonAttribute string // Comparator holds how the compare the above user // attribute to the comparison value. Comparator Operator // ComparisonValue holds the value to compare the // user attribute against. ComparisonValue string // Value holds the value for the flag if the rule is satisfied. // It should hold one of the types string, float64, int or bool // and be the same type as the default value of the // flag that it's associated with. Value interface{} }
Click to show internal directories.
Click to hide internal directories.