feature

package
v0.22.15 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DisableResources = "disable_resources"
View Source
const Events = "events"
View Source
const Facets = "facets"
View Source
const Labels = "labels"
View Source
const LiveUpdateV2 = "live_update_v2"
View Source
const MultipleContainersPerPod = "multiple_containers_per_pod"
View Source
const Snapshots = "snapshots"
View Source
const UpdateHistory = "update_history"

Variables

View Source
var MainDefaults = Defaults{
	MultipleContainersPerPod: Value{
		Enabled: true,
		Status:  Obsolete,
	},
	Events: Value{
		Enabled: true,
		Status:  Obsolete,
	},
	Snapshots: Value{
		Enabled: true,
		Status:  Active,
	},
	UpdateHistory: Value{
		Enabled: false,
		Status:  Active,
	},
	Facets: Value{
		Enabled: true,
		Status:  Obsolete,
	},
	Labels: Value{
		Enabled: true,
		Status:  Active,
	},
	LiveUpdateV2: Value{
		Enabled: false,
		Status:  Active,
	},
	DisableResources: Value{
		Enabled: false,
		Status:  Active,
	},
}

MainDefaults is the defaults we use in Main

Functions

This section is empty.

Types

type Defaults

type Defaults map[string]Value

Defaults is the initial values for a FeatureSet. Don't modify after initializing.

type FeatureSet added in v0.9.5

type FeatureSet map[string]Value

FeatureSet is a mutable set of Features.

func FromDefaults added in v0.9.5

func FromDefaults(d Defaults) FeatureSet

Create a FeatureSet from defaults.

func (FeatureSet) Get added in v0.9.5

func (s FeatureSet) Get(name string) bool

Get gets whether a feature is enabled.

func (FeatureSet) Set added in v0.9.5

func (s FeatureSet) Set(name string, enabled bool) error

Set sets enabled for a feature if it's active. Returns an error if flag is unknown or obsolete.

func (FeatureSet) ToEnabled added in v0.9.5

func (s FeatureSet) ToEnabled() map[string]bool

ToEnabled returns a copy of the enabled values of the FeatureSet

type ObsoleteError added in v0.9.5

type ObsoleteError string

ObsoleteError is an error that a feature flag is obsolete

func (ObsoleteError) Error added in v0.9.5

func (s ObsoleteError) Error() string

type Status added in v0.9.5

type Status int

The status of a feature flag It starts as Active (we're using this flag to evaluate the feature) Then when we no longer need it, we make it a noop. Leave it for an upgrade cycle. Then move it to Obsolete, which will cause a warning. Leave it for an upgrade cycle. Then remove the flag altogether.

const (
	Active Status = iota
	Noop
	Obsolete
)

type Value added in v0.9.5

type Value struct {
	Enabled bool
	Status  Status
}

The Value a flag can have. Status should never be changed.

Jump to

Keyboard shortcuts

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