https://github.com/go-kratos/feature
Feature gates.
https://github.com/go-kratos/feature
feature-flags feature-gates features
Last synced: 30 days ago
JSON representation
Feature gates.
- Host: GitHub
- URL: https://github.com/go-kratos/feature
- Owner: go-kratos
- License: mit
- Created: 2023-07-23T16:05:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T16:01:00.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T11:25:35.475Z (about 1 year ago)
- Topics: feature-flags, feature-gates, features
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 9
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Feature Gates
Feature gates are a set of key=value pairs that describe features. You can turn these features on or off using the `--feature-gates=foo=true,bar=false` command line flag on each component.### Usage
```go
var foo = feature.MustRegister("Foo", false,
feature.WithFeatureStage(feature.StageAlpha),
feature.WithFeatureFromVersion("0.0.1"),
feature.WithFeatureToVersion("1.0.0"),
feature.WithFeatureDescription("A foo feature"),
)
if foo.Enabled() {
// TODO Feature
}
```
### References
- [Kubernetes Feature Gates](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/)