featureflag

package
Version: v1.103.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const EnvVar = "SPOTINST_FEATURE_FLAGS"

EnvVar is the name of the environment variable to read feature flags from. The value should be a comma-separated list of K=V flags, while V is optional.

Variables

View Source
var (
	// Toggle the usage of merging credentials in chain provider.
	//
	// This feature allows users to configure their credentials using multiple
	// providers. For example, a token can be statically configured using a file,
	// while the account can be dynamically configured via environment variables.
	MergeCredentialsChain = New("MergeCredentialsChain", false)
)

Default features.

Functions

func Set

func Set(features string)

Set parses and stores features from a string like "feature1=true,feature2=false".

Types

type FeatureFlag

type FeatureFlag interface {
	fmt.Stringer

	// Name returns the name of the feature flag.
	Name() string

	// Enabled returns true if the feature is enabled.
	Enabled() bool
}

FeatureFlag indicates whether a given feature is enabled or not.

func Get

func Get(name string) FeatureFlag

Get returns a specific feature flag by name.

func New

func New(name string, enabled bool) FeatureFlag

New returns a new feature flag.

type FeatureFlags

type FeatureFlags []FeatureFlag

FeatureFlags defines a list of feature flags.

func All

func All() FeatureFlags

All returns a list of all known feature flags.

func (FeatureFlags) String

func (f FeatureFlags) String() string

String returns the string representation of a list of feature flags.

Jump to

Keyboard shortcuts

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