alpha

package
v0.0.0-...-4d33260 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnableCommand

func GetEnableCommand(key FeatureId) string

GetEnableCommand provides a message for how to enable the alpha feature.

func SetDefaultEnablement

func SetDefaultEnablement(id string, val bool)

SetDefaultEnablement sets the default enablement value for the given feature id.

Types

type Feature

type Feature struct {
	Id          string `yaml:"id"`
	Description string `yaml:"description"`
	Status      string
}

Feature defines the structure for a feature in alpha mode.

type FeatureId

type FeatureId string

constant keys are used within source code to pull the AlphaFeature

const (
	// the key for overriding all alpha features value.
	AllId FeatureId = "all"
)

func IsFeatureKey

func IsFeatureKey(key string) (featureId FeatureId, isAlpha bool)

IsFeatureKey inspect if `key` is an alpha feature. Returns the AlphaFeatureId and true in case it is. otherwise returns empty AlphaFeatureId and false.

func MustFeatureKey

func MustFeatureKey(key string) FeatureId

MustFeatureKey converts the given key to a FeatureId as IsFeatureKey would and panics if the conversion fails.

type FeatureManager

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

FeatureManager provides operations for handling features within the application which are in alpha mode.

func NewFeaturesManager

func NewFeaturesManager(configManager config.UserConfigManager) *FeatureManager

NewFeaturesManager creates the alpha features manager from the user configuration

func NewFeaturesManagerWithConfig

func NewFeaturesManagerWithConfig(config config.Config) *FeatureManager

func (*FeatureManager) IsEnabled

func (m *FeatureManager) IsEnabled(featureId FeatureId) bool

IsEnabled search and find out if the AlphaFeatureId is currently enabled

func (*FeatureManager) ListFeatures

func (m *FeatureManager) ListFeatures() (map[string]Feature, error)

ListFeatures pulls the list of features in alpha mode available within the application and displays its current state which is `on` or `off`.

Jump to

Keyboard shortcuts

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