Documentation
¶
Overview ¶
Package features enables a way to encode enabled features in a flag.FlagSet.
Example ¶
Output:
flag "protected" requires feature "test-feature" to be provided in --enable-features
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
func Enabled(fs *flag.FlagSet, name Feature) bool
Enabled returns true if a feature is enabled. Enable will panic if fs has not been passed to Register or name is an unknown feature.
func GetAllEnabled ¶ added in v0.25.0
func GetAllEnabled(fs *flag.FlagSet) []string
GetAllEnabled returns the list of all enabled features
Types ¶
type Dependency ¶
type Dependency struct {
// Flag must be a flag name from a FlagSet.
Flag string
// Feature which must be enabled for Flag to be provided at the command line.
Feature Feature
}
Dependency marks a Flag as depending on a specific feature being enabled.
Click to show internal directories.
Click to hide internal directories.