Lightweight, embeddable, and pluggable OpenFeature compatible feature flag engine for Go. Designed for pipelines, microservices, and event-driven systems.
ducto-featureflags
is a minimalist feature flag manager built in Go. It was designed as a reusable component for:
- Data transformation pipelines (like Ducto)
- Serverless functions
- Microservices and APIs
- CLI tools and test harnesses
It supports both static file-based flags and dynamic backends, and can be used as:
- A Go SDK (directly, or as an OpenFeature Provider)
- A CLI for testing
- A preprocessor plugin in the ducto-orchestrator
Please note that whilst Ducto Feature Flags is compatible with OpenFeature, it is not compliant with flagd because we support nested conditional statements, which cannot be reduced to flagd's simpler conditional system. Once flagd can support nested conditionals like 'and' and 'or', we will provide support.
- 🔍 Evaluate flags at runtime
- 🧩 Simple JSON/YAML flag format
- ♻️ Optional hot-reloading (fsnotify)
- 🤝 OpenFeature compatible
- 🌐 Future: HTTP / Redis / Consul backends
- 🔓 MIT licensed and reusable in other OSS projects
The simplest possible flag file is static like so:
{
"ui": {
"variants": {
"beta": true,
"stable": false
},
"defaultVariant": "stable"
}
}
To make this more dynamic, you can add rules based on an EvalContext
:
{
"new_ui": {
"variants": {
"beta": true,
"stable": false
},
"defaultVariant": "stable",
"rules": [
{ "if": { "env": "prod", "group": "beta" }, "variant": "beta" },
{ "if": { "env": "prod" }, "variant": "stable" }
]
}
}
You can also make use of YAML files, like this example here.
store, err := featureflags.NewStoreFromFile("flags.json")
// assert no error
if store.IsEnabled("new_ui", featureflags.EvalContext{}) {
// Enable experimental flow
}
go get -u github.com/tommed/ducto-featureflags
Check our OpenFeature example here
go install github.com/tommed/ducto-featureflags/cmd/ducto-flags@latest
# Check if a single flag is enabled
ducto-flags -file flags.json -key new_ui -ctx env=prod -ctx region=EU
# Print all flags
ducto-flags -file flags.json -list
# Host a flags server (optional auth token)
ducto-flags serve -file flags.json [-token secret-123]
- JSON file
- YAML file
- HTTP endpoint
- OpenFeature compatibility
- OpenFeature provider
- Redis
- Google Firestore
- Env var overrides
- Versioned flag API with auditing
- ducto-dsl – declarative data transformation engine
- ducto-orchestrator – pluggable streaming runtime
ducto-featureflags
– this repo
- Code licensed under MIT
- Logos and illustrations (and their likeness) are (c) Copyright 2025 Tom Medhurst, all rights reserved.