featuregate

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package featuregate provides a way to gate features in the collector based on different options, such as the feature's stability level and user-defined minimum allowed stability level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowedValues

func AllowedValues() []string

func CheckAllowed

func CheckAllowed(stability Stability, minStability Stability, featureName string) error

Types

type Stability

type Stability int

Stability is used to designate the stability level of a feature or a minimum stability level the collector is allowed to operate with.

const (

	// StabilityUndefined is the default value for Stability, which indicates an error and should never be used.
	StabilityUndefined Stability = iota
	// StabilityExperimental is used to designate features in the Experimental
	// stage.
	StabilityExperimental
	// StabilityPublicPreview is used to designate features in the Public Preview
	// stage.
	StabilityPublicPreview
	// StabilityGenerallyAvailable is used to designate features in the Generally
	// Available stage.
	StabilityGenerallyAvailable
)

func (Stability) Permits added in v1.1.0

func (s Stability) Permits(stability Stability) bool

Permits will check if the stability level is allowed. For instance experimental would allow public preview, experimental and ga. Whereas ga would only allow ga.

func (*Stability) Set

func (s *Stability) Set(str string) error

Set implements the pflag.Value interface.

func (Stability) String

func (s Stability) String() string

String implements the pflag.Value interface. The returned strings are "double-quoted" already.

func (Stability) Type

func (s Stability) Type() string

Type implements the pflag.Value interface. This value is displayed as a placeholder in help messages.

Jump to

Keyboard shortcuts

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