Documentation
¶
Index ¶
- Constants
- func Bucket(flagKey string, user DataContext, rollout Rollout) bool
- func NewCELEnv() (*cel.Env, error)
- func NewCELEnvForContext(schema *ContextSchema) (*cel.Env, error)
- type BucketTrace
- type CompiledRule
- type ContextField
- type ContextSchema
- type ContextType
- type DataContext
- type Definitions
- type Engine
- func (e *Engine) CompileFlag(key string, config FlagConfig) (*Flag, error)
- func (e *Engine) CompileFlagForContext(key string, config FlagConfig, schema *ContextSchema) (*Flag, error)
- func (e *Engine) Evaluate(flag *Flag, data DataContext) FlagValue
- func (e *Engine) EvaluateConfig(config FlagConfig, data DataContext) EvaluationTrace
- func (e *Engine) EvaluateConfigForContext(config FlagConfig, schema *ContextSchema, data DataContext) EvaluationTrace
- func (e *Engine) EvaluateResult(flag *Flag, data DataContext) EvaluationResult
- func (e *Engine) EvaluateTrace(flag *Flag, data DataContext) EvaluationTrace
- type EvalContext
- type EvaluationResult
- type EvaluationTrace
- type Evaluator
- type Flag
- type FlagConfig
- type FlagDefinition
- type FlagValue
- type MatchedRuleTrace
- type Rollout
- type Rule
- type RuleEvaluationTrace
- type ValueType
Constants ¶
View Source
const ( ValueTypeBoolean = eval.ValueTypeBoolean ValueTypeString = eval.ValueTypeString ValueTypeNumber = eval.ValueTypeNumber ValueTypeJSON = eval.ValueTypeJSON )
View Source
const ( ContextTypeString = eval.ContextTypeString ContextTypeInt = eval.ContextTypeInt ContextTypeDouble = eval.ContextTypeDouble ContextTypeBool = eval.ContextTypeBool ContextTypeTimestamp = eval.ContextTypeTimestamp ContextTypeList = eval.ContextTypeList ContextTypeMap = eval.ContextTypeMap )
Variables ¶
This section is empty.
Functions ¶
func NewCELEnvForContext ¶
func NewCELEnvForContext(schema *ContextSchema) (*cel.Env, error)
Types ¶
type BucketTrace ¶
type BucketTrace = eval.BucketTrace
type CompiledRule ¶
type CompiledRule = eval.CompiledRule
type ContextField ¶
type ContextField = eval.ContextField
type ContextSchema ¶
type ContextSchema = eval.ContextSchema
type ContextType ¶
type ContextType = eval.ContextType
type DataContext ¶
type DataContext = eval.DataContext
type Definitions ¶
type Definitions struct {
Flags []FlagDefinition `json:"flags"`
Contexts []ContextSchema `json:"contexts,omitempty"`
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CompileFlag ¶
func (e *Engine) CompileFlag(key string, config FlagConfig) (*Flag, error)
func (*Engine) CompileFlagForContext ¶
func (e *Engine) CompileFlagForContext(key string, config FlagConfig, schema *ContextSchema) (*Flag, error)
func (*Engine) EvaluateConfig ¶
func (e *Engine) EvaluateConfig(config FlagConfig, data DataContext) EvaluationTrace
func (*Engine) EvaluateConfigForContext ¶
func (e *Engine) EvaluateConfigForContext(config FlagConfig, schema *ContextSchema, data DataContext) EvaluationTrace
func (*Engine) EvaluateResult ¶
func (e *Engine) EvaluateResult(flag *Flag, data DataContext) EvaluationResult
func (*Engine) EvaluateTrace ¶
func (e *Engine) EvaluateTrace(flag *Flag, data DataContext) EvaluationTrace
type EvalContext ¶
type EvalContext = eval.EvalContext
type EvaluationResult ¶
type EvaluationResult = eval.EvaluationResult
type EvaluationTrace ¶
type EvaluationTrace = eval.EvaluationTrace
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
func Load ¶
func Load(defs Definitions) (*Evaluator, error)
func (*Evaluator) Evaluate ¶
func (e *Evaluator) Evaluate(key string, ctx DataContext) EvaluationResult
func (*Evaluator) EvaluateAll ¶
func (e *Evaluator) EvaluateAll(ctx DataContext) map[string]EvaluationResult
type FlagConfig ¶
type FlagConfig = eval.FlagConfig
type FlagDefinition ¶
type FlagDefinition struct {
FlagConfig
ContextSchema *ContextSchema `json:"context_schema,omitempty"`
}
type MatchedRuleTrace ¶
type MatchedRuleTrace = eval.MatchedRuleTrace
type RuleEvaluationTrace ¶
type RuleEvaluationTrace = eval.RuleEvaluationTrace
Click to show internal directories.
Click to hide internal directories.