Overview
By default the Flagmint Go SDK uses remote evaluation: the flag value is computed server-side on each request and streamed to the client. Local evaluation moves the computation into the client process using downloaded rule configurations.When to Use Local Evaluation
| Use case | Recommendation |
|---|---|
| Server-side, high-throughput applications | ✅ Local — sub-millisecond latency, no per-flag network calls |
| Batch jobs / data pipelines | ✅ Local — evaluate millions of flags offline |
| Client-side applications (browser, mobile) | ⚠️ Remote — full flag configs expose your rule logic |
| Low-traffic services that can tolerate 5–50 ms | Remote is simpler |
Performance Characteristics
| Aspect | Remote | Local |
|---|---|---|
| Latency per flag | 5–50 ms | < 0.1 ms |
| Network dependency | Every evaluation | Config fetch only |
| Billing | Per evaluation call | Per config fetch |
| Flag config visibility | Server-side only | Full config on client |
| Offline resilience | ❌ | ✅ (once config is downloaded) |
Enabling Local Evaluation
PassWithLocalEvaluation() when constructing the client:
Supplying Flag Configurations
In local evaluation mode, evaluations useFlagConfig objects that describe
targeting rules and variations. Fetch them from the /evaluator/config
endpoint and call SetFlagConfigs whenever the config changes:
SetFlagConfigs replaces the entire config map atomically. Call it again
whenever you receive an updated config from the server.
Evaluating Flags
Use the same typed methods as with remote evaluation:BoolFlag, StringFlag, and NumberFlag all route through the local
evaluator when WithLocalEvaluation() is active.
Targeting Rules
FlagConfig.TargetingRules is evaluated in ascending OrderIndex order. The
first rule whose conditions are all satisfied wins.
Supported operators
| Operator | Constant | Description |
|---|---|---|
| Equals | evaluate.OpEquals | Strict equality |
| Not equals | evaluate.OpNotEquals | Inverse equality |
| Contains | evaluate.OpContains | Substring / set membership |
| Not contains | evaluate.OpNotContains | Inverse |
| Starts with | evaluate.OpStartsWith | String prefix |
| Ends with | evaluate.OpEndsWith | String suffix |
| Greater than | evaluate.OpGreaterThan | Numeric comparison |
| Less than | evaluate.OpLessThan | Numeric comparison |
| Greater than or equal | evaluate.OpGreaterThanOrEqual | Numeric comparison |
| Less than or equal | evaluate.OpLessThanOrEqual | Numeric comparison |
Percentage rollouts
UseTargetingRule.RolloutPercentage to do a stable, deterministic percentage
rollout based on the user key:
Architecture
SetFlagConfigs bridges the transport and the local evaluator.
Management API coming soon. Automated config sync (calling SetFlagConfigs automatically when the server pushes a new config) will be added in a future release.