Documentation ¶
Index ¶
- Constants
- type AnyValue
- type Evaluators
- type Flags
- type IEvaluator
- type JSONEvaluator
- func (je *JSONEvaluator) GetState() (string, error)
- func (je *JSONEvaluator) ResolveAllValues(reqID string, context *structpb.Struct) []AnyValue
- func (je *JSONEvaluator) ResolveBooleanValue(reqID string, flagKey string, context *structpb.Struct) (value bool, variant string, reason string, err error)
- func (je *JSONEvaluator) ResolveFloatValue(reqID string, flagKey string, context *structpb.Struct) (value float64, variant string, reason string, err error)
- func (je *JSONEvaluator) ResolveIntValue(reqID string, flagKey string, context *structpb.Struct) (value int64, variant string, reason string, err error)
- func (je *JSONEvaluator) ResolveObjectValue(reqID string, flagKey string, context *structpb.Struct) (value map[string]any, variant string, reason string, err error)
- func (je *JSONEvaluator) ResolveStringValue(reqID string, flagKey string, context *structpb.Struct) (value string, variant string, reason string, err error)
- func (je *JSONEvaluator) SetState(payload sync.DataSync) (map[string]interface{}, bool, error)
Constants ¶
View Source
const (
Disabled = "DISABLED"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evaluators ¶ added in v0.0.8
type Evaluators struct {
Evaluators map[string]json.RawMessage `json:"$evaluators"`
}
type IEvaluator ¶
type IEvaluator interface { GetState() (string, error) SetState(payload sync.DataSync) (map[string]interface{}, bool, error) ResolveBooleanValue( reqID string, flagKey string, context *structpb.Struct) (value bool, variant string, reason string, err error) ResolveStringValue( reqID string, flagKey string, context *structpb.Struct) (value string, variant string, reason string, err error) ResolveIntValue( reqID string, flagKey string, context *structpb.Struct) (value int64, variant string, reason string, err error) ResolveFloatValue( reqID string, flagKey string, context *structpb.Struct) (value float64, variant string, reason string, err error) ResolveObjectValue( reqID string, flagKey string, context *structpb.Struct) (value map[string]any, variant string, reason string, err error) ResolveAllValues( reqID string, context *structpb.Struct) (values []AnyValue) }
IEvaluator implementations store the state of the flags, do parsing and validation of the flag state and evaluate flags in response to handlers.
type JSONEvaluator ¶ added in v0.0.3
func NewJSONEvaluator ¶ added in v0.2.7
func NewJSONEvaluator(logger *logger.Logger, s *store.Flags) *JSONEvaluator
func (*JSONEvaluator) GetState ¶ added in v0.0.3
func (je *JSONEvaluator) GetState() (string, error)
func (*JSONEvaluator) ResolveAllValues ¶ added in v0.3.1
func (je *JSONEvaluator) ResolveAllValues(reqID string, context *structpb.Struct) []AnyValue
func (*JSONEvaluator) ResolveBooleanValue ¶ added in v0.0.3
func (*JSONEvaluator) ResolveFloatValue ¶ added in v0.0.6
func (*JSONEvaluator) ResolveIntValue ¶ added in v0.0.6
func (*JSONEvaluator) ResolveObjectValue ¶ added in v0.0.3
func (*JSONEvaluator) ResolveStringValue ¶ added in v0.0.3
Source Files ¶
Click to show internal directories.
Click to hide internal directories.