Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFeatureGates = NewFeatureGate()
Default feature gates instance
View Source
var (
VirtualNet = Feature("VirtualNet")
)
Define all available features here
Functions ¶
func SetFromMap ¶
SetFromMap sets feature gate values from a map in the default feature gates
Types ¶
type FeatureGate ¶
type FeatureGate interface {
// Enabled returns true if the key is enabled
Enabled(key Feature) bool
// KnownFeatures returns a slice of strings describing the known features
KnownFeatures() []string
}
FeatureGate indicates whether a given feature is enabled or not
type FeatureSpec ¶
type FeatureSpec struct {
// Default is the default enablement state for the feature
Default bool
// LockToDefault indicates the feature cannot be changed from its default
LockToDefault bool
// Stage indicates the maturity level of the feature
Stage FeatureStage
}
FeatureSpec describes a feature and its properties
type FeatureStage ¶
type FeatureStage string
FeatureStage represents the maturity level of a feature
const ( // Alpha means the feature is experimental and disabled by default Alpha FeatureStage = "ALPHA" // Beta means the feature is more stable but still might change and is disabled by default Beta FeatureStage = "BETA" // GA means the feature is generally available and enabled by default GA FeatureStage = "" )
type MutableFeatureGate ¶
type MutableFeatureGate interface {
FeatureGate
// SetFromMap sets feature gate values from a map[string]bool
SetFromMap(m map[string]bool) error
// Add adds features to the feature gate
Add(features map[Feature]FeatureSpec) error
// String returns a string representing the feature gate configuration
String() string
}
MutableFeatureGate allows for dynamic feature gate configuration
func NewFeatureGate ¶
func NewFeatureGate() MutableFeatureGate
NewFeatureGate creates a new feature gate with the default features
Click to show internal directories.
Click to hide internal directories.