features

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled(feature string) (bool, error)

Enabled verifies whether the feature is enabled or not.

Types

type FeatureGates

type FeatureGates struct {
	// contains filtered or unexported fields
}

FeatureGates is a helper to manage feature switches.

Controllers can set their supported features and then at runtime verify which ones are enabled/disabled.

Callers have to call BindFlags, and then call SupportedFeatures to set the supported features and their default values.

func (*FeatureGates) BindFlags

func (o *FeatureGates) BindFlags(fs *pflag.FlagSet)

BindFlags will parse the given pflag.FlagSet and load feature gates accordingly.

func (*FeatureGates) SupportedFeatures

func (o *FeatureGates) SupportedFeatures(features map[string]bool) error

SupportedFeatures sets the supported features and their default values.

func (*FeatureGates) WithLogger

func (o *FeatureGates) WithLogger(l logr.Logger) *FeatureGates

WithLogger sets the logger to be used when loading supported features.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL