Version: v1.334.0 Latest Latest

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 3




View Source

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.


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.


func Set

func Set(features string)

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


type FeatureFlag

type FeatureFlag interface {

	// 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