featureconfig

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// FeatureACReservation store name for ACReservation feature
	FeatureACReservation = "ACReservation"
	// FeatureNodeIDFromAnnotation store name for NodeIDFromAnnotation feature
	FeatureNodeIDFromAnnotation = "NodeIDFromAnnotation"
	// FeatureExternalAnnotationForNode store name for ExternalAnnotationForNodeID feature
	FeatureExternalAnnotationForNode = "ExternalAnnotationForNode"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FeatureChecker

type FeatureChecker interface {
	// IsEnabled check if features is enabled
	IsEnabled(name string) bool
	// List list all features
	List() []string
}

FeatureChecker is a "read" interface for FeatureConfig

type FeatureConfig

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

FeatureConfig store features flags

func NewFeatureConfig

func NewFeatureConfig() *FeatureConfig

NewFeatureConfig returns new instance of FeatureConfig

func (*FeatureConfig) IsEnabled

func (f *FeatureConfig) IsEnabled(name string) bool

IsEnabled is implementation of FeatureChecker interface

func (*FeatureConfig) List

func (f *FeatureConfig) List() []string

List is implementation of FeatureChecker interface

func (*FeatureConfig) Update

func (f *FeatureConfig) Update(name string, enabled bool)

Update is implementation of FeatureConfigurator interface

type FeatureConfigurator

type FeatureConfigurator interface {
	FeatureChecker
	// Update adds new feature or update existing
	Update(name string, enabled bool)
}

FeatureConfigurator is a "write" interface for FeatureConfig

Jump to

Keyboard shortcuts

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