https://github.com/tommed/ducto-featureflags
A lightweight, embeddable, and pluggable feature flag engine for Go — built for serverless systems, event-driven pipelines, and real-time dataflows. Part of the Ducto ecosystem, but reusable anywhere.
https://github.com/tommed/ducto-featureflags
configuration declarative ducto event-processing feature-flags flag-engine go golang-library json launchdarkly-alternative microservices open-source pipeline-automation sdk serverless
Last synced: 10 months ago
JSON representation
A lightweight, embeddable, and pluggable feature flag engine for Go — built for serverless systems, event-driven pipelines, and real-time dataflows. Part of the Ducto ecosystem, but reusable anywhere.
- Host: GitHub
- URL: https://github.com/tommed/ducto-featureflags
- Owner: tommed
- License: mit
- Created: 2025-04-07T13:31:52.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-04-07T14:29:41.000Z (10 months ago)
- Last Synced: 2025-04-07T14:41:14.548Z (10 months ago)
- Topics: configuration, declarative, ducto, event-processing, feature-flags, flag-engine, go, golang-library, json, launchdarkly-alternative, microservices, open-source, pipeline-automation, sdk, serverless
- Language: Go
- Homepage:
- Size: 6.97 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Ducto Feature Flags
[](https://github.com/tommed/ducto-featureflags/actions/workflows/ci.yml)
[](https://codecov.io/gh/tommed/ducto-featureflags)
> Lightweight, embeddable, and pluggable feature flag engine for Go — designed for pipelines, microservices, and event-driven systems.
---
## ✨ What is Ducto-FeatureFlags?
`ducto-featureflags` is a minimalist feature flag manager built in Go. It was designed as a reusable component for:
- Data transformation pipelines (like [Ducto](https://github.com/tommed))
- Serverless functions
- Microservices and APIs
- CLI tools and test harnesses
It supports both static file-based flags and dynamic backends (coming soon), and can be used as:
- A **Go SDK**
- A **CLI for testing**
- A **preprocessor plugin** in the [ducto-orchestrator](https://github.com/tommed/ducto-orchestrator)
---
## ✅ Features
- 🔍 Evaluate flags at runtime
- 🧩 Simple JSON/YAML flag format
- ♻️ Optional hot-reloading (fsnotify)
- 🌐 Future: HTTP / Redis / Consul backends
- 🔓 MIT licensed and reusable in other OSS projects
---
## 🔧 Example Flag File
The simplest possible flag file is static like so:
```json
{
"flags": {
"new_ui": {
"enabled": true
},
"beta_mode": {
"enabled": false
}
}
}
```
To make this more dynamic, you can add rules based on an `EvalContext`:
```json
{
"flags": {
"new_ui": {
"rules": [
{ "if": { "env": "prod", "group": "beta" }, "value": true },
{ "if": { "env": "prod" }, "value": false }
],
"enabled": true
}
}
}
```
You can also make use of YAML files, like this [example here](./examples/with_rules.yaml).
---
## 🧑💻 Usage (SDK)
```golang
store, _ := featureflags.NewStoreFromFile("flags.json")
if store.IsEnabled("new_ui", featureflags.EvalContext{}) {
// Enable experimental flow
}
```
---
## 📦 Install
```bash
go install github.com/tommed/ducto-featureflags/cmd/ducto-flags@latest
```
### CLI Usage
```bash
# 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]
```
---
## 🛠️ Planned Backends
- [x] JSON file
- [x] YAML file
- [x] HTTP endpoint
- [ ] Redis
- [ ] Google Firestore
- [ ] Env var overrides
- [ ] Versioned flag API with auditing
---
## 🤖 Part of the Ducto Ecosystem
- [ducto-dsl](https://github.com/tommed/ducto-dsl) – declarative data transformation engine
- [ducto-orchestrator](https://github.com/tommed/ducto-orchestrator) – pluggable streaming runtime
- `ducto-featureflags` – this repo
---
## 🧰 License
- Code licensed under [MIT](./LICENSE)
- Logos and illustrations (and their likeness) are (c) Copyright 2025 Tom Medhurst, all rights reserved.