How thomaspoignant/go-feature-flag works
GO Feature Flag is a self-hosted feature-flag service and SDK ecosystem. Its principal workflow is an application requesting a flag evaluation from the relay proxy, which routes the request to a flagset client and returns a result evaluated against configured flags and user context. The Go module also supports in-process evaluation; the README describes OpenFeature support across languages. The graph includes configuration retrieval, evaluation, data export, notifications, and streaming updates. Some subsystem links reflect documented capabilities and tree structure; unsampled implementation details are not asserted.
Main entry points: flagset_manager.go Flagset manager · server.go HTTP API · main.go Relay proxy · routes_goff.go API routes
Components 23
Relay runtime
- Relay proxy
cmd/relayproxy/main.go - HTTP API
cmd/relayproxy/api/server.go - API routes
cmd/relayproxy/api/routes_goff.go - Evaluation handlers
cmd/relayproxy/handler/goff/flag_eval.go - OFREP handler
cmd/relayproxy/handler/ofrep/evaluate.go - Flagset manager
cmd/relayproxy/service/flagset_manager.go - Proxy configuration
cmd/relayproxy/config/config.go - Streaming updates
cmd/relayproxy/service/stream
Flag configuration
- Retriever manager
retriever/manager.go - Storage retrievers
retriever - Flag cache
internal/cache/cache_manager.go - Flag definitions
modules/core/flag/flag.go
Evaluation
- Evaluation context
modules/core/ffcontext/context.go - Core evaluation
modules/core/evaluation/evaluation.go - Variation result
modules/core/model/variation_result.go
Data integrations
- Export manager
exporter/manager.go - Export destinations
exporter - Change notifiers
notifier/notifier.go
SDK ecosystem
- Go SDK
feature_flag.go - OpenFeature providers
openfeature/providers
Other components
- Application
- Configuration stores
- Export destinations
Connections 26
- Application → HTTP API: requests flags
- Relay proxy → Proxy configuration: loads settings
- Relay proxy → Flagset manager: initializes
- Relay proxy → HTTP API: starts server
- HTTP API → API routes: registers routes
- API routes → Evaluation handlers: dispatches evaluation
- API routes → OFREP handler: dispatches OFREP
- Flagset manager → Retriever manager: creates clients
- Retriever manager → Storage retrievers: retrieves flags
- Retriever manager → Flag cache: updates cache
- Storage retrievers → Configuration stores: loads configuration
- Flag cache → Flag definitions: holds flags
- Evaluation handlers → Flagset manager: selects flagset
- OFREP handler → Flagset manager: selects flagset
- Flagset manager → Go SDK: manages clients
- Go SDK → Core evaluation: evaluates flags
- Core evaluation → Evaluation context: uses targeting context
- Core evaluation → Variation result: produces result
- Variation result → Evaluation handlers: returns evaluation
- Variation result → OFREP handler: returns evaluation
- Go SDK → Export manager: records events
- Export manager → Export destinations: dispatches events
- Export destinations → Export destinations: exports data
- Flag cache → Change notifiers: announces changes
- Change notifiers → Streaming updates: notifies clients
- OpenFeature providers → HTTP API: uses relay API