engine

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateFlag

EvaluateFlag performs sub-millisecond evaluation of a flag for a given context

func EvaluateRule

func EvaluateRule(rule domain.TargetingRule, ctx domain.EvaluationContext) bool

EvaluateRule checks if targeting rule condition matches context

func FNV1a64

func FNV1a64(input string) uint64

FNV1a64 computes deterministic 64-bit FNV-1a hash

func GetStickyBucket

func GetStickyBucket(identifier string, salt string) (float64, string)

GetStickyBucket computes sticky percentage bucket (0.00 to 99.99)

func ResolveMultivariateVariant

func ResolveMultivariateVariant(variants []domain.FlagVariant, identifier, flagKey string) (domain.FlagVariant, float64, string)

ResolveMultivariateVariant picks variant based on weights and hash

func RunBenchmark

func RunBenchmark(flag domain.FeatureFlag, env domain.Environment, iterations int) domain.BenchmarkMetrics

RunBenchmark executes a high-concurrency stress test and computes latency percentiles

Types

type EvaluationTrace added in v1.2.0

type EvaluationTrace struct {
	FlagKey        string                  `json:"flag_key"`
	Environment    domain.Environment      `json:"environment"`
	IdentifierUsed string                  `json:"identifier_used"`
	Steps          []RuleEvaluationStep    `json:"steps"`
	FinalReason    domain.EvaluationReason `json:"final_reason"`
	FinalVariant   string                  `json:"final_variant"`
	FinalEnabled   bool                    `json:"final_enabled"`
	Bucket         float64                 `json:"bucket"`
	ElapsedNs      int64                   `json:"elapsed_ns"`
}

EvaluationTrace contains comprehensive diagnostics for an evaluation request

func EvaluateFlagWithTrace added in v1.2.0

EvaluateFlagWithTrace performs evaluation and builds a step-by-step diagnostics trace

type RuleEvaluationStep added in v1.2.0

type RuleEvaluationStep struct {
	StepIndex int    `json:"step_index"`
	Name      string `json:"name"`
	Passed    bool   `json:"passed"`
	Detail    string `json:"detail"`
}

RuleEvaluationStep represents an individual targeting condition check

Jump to

Keyboard shortcuts

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