Categorygithub.com/go-kratos/feature
repositorypackage
0.0.0-20230724160043-79ea0633def6
Repository: https://github.com/go-kratos/feature.git
Documentation: pkg.go.dev

# 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

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