evalcore

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 Bucket

func Bucket(flagKey string, user DataContext, rollout Rollout) bool

func NewCELEnv

func NewCELEnv() (*cel.Env, error)

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 NewEngine

func NewEngine(celEnv *cel.Env) *Engine

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) Evaluate

func (e *Engine) Evaluate(flag *Flag, data DataContext) FlagValue

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 Flag

type Flag = eval.Flag

type FlagConfig

type FlagConfig = eval.FlagConfig

type FlagDefinition

type FlagDefinition struct {
	FlagConfig
	ContextSchema *ContextSchema `json:"context_schema,omitempty"`
}

type FlagValue

type FlagValue = eval.FlagValue

type MatchedRuleTrace

type MatchedRuleTrace = eval.MatchedRuleTrace

type Rollout

type Rollout = eval.Rollout

type Rule

type Rule = eval.Rule

type RuleEvaluationTrace

type RuleEvaluationTrace = eval.RuleEvaluationTrace

type ValueType

type ValueType = eval.ValueType

Directories

Path Synopsis
cmd
wasm command
internal
eval
In package eval — what evaluation operates on.
In package eval — what evaluation operates on.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL