Flipt
Load a flag from Flipt, the Go-native open-source feature-flag server.
| Scheme | flipt:// |
| Module | github.com/xavidop/mamori/providers/flipt |
| Sensitive | no |
| Watch | poll |
| Auth | FLIPT_URL (+ optional token) |
Install
go get github.com/xavidop/mamori/providers/flipt
import _ "github.com/xavidop/mamori/providers/flipt"
Using the ref
A flipt:// ref points at one flag within a namespace, evaluated for an entity.
flipt://<namespace>/<flag-key>[?entity=<id>]
| Part | Required | What it means |
|---|---|---|
<namespace> |
yes | The Flipt namespace (use default if you have not created others). |
<flag-key> |
yes | The flag key. |
?entity= |
no | The evaluation entity id. Defaults to mamori. |
A boolean flag resolves to true / false; a variant flag resolves to the matched variant key. A flag that does not exist resolves to not-found.
Examples
flipt://default/new-billingon a boolean flag resolves totrue/false.flipt://default/experiment-a?entity=service-1on a variant flag resolves to the variant matched forservice-1.
Watch
Flipt is evaluated over its API; mamori polls (WithPollInterval + jitter).
Configuration
import fliptprov "github.com/xavidop/mamori/providers/flipt"
mamori.WithProvider(fliptprov.New(
fliptprov.WithURL(os.Getenv("FLIPT_URL")),
fliptprov.WithToken(os.Getenv("FLIPT_TOKEN")),
))
Verified with an injected fake (un-seeded flags resolve to not-found); live behavior is covered by //go:build integration tests.