featureflags

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MPL-2.0 Imports: 1 Imported by: 1

Documentation

Overview

The featureflags module exists to control optional functionality

The main purpose is to hide functionality that is still in development, that isn't yet fully featured enough to be GA, or that isn't relevant to all users.

The format is key-value, both strings, for rare situations where new values need to be introduced to the same flag. You should usually treat the value as a boolean - create one flag per alternative, don't create complicated sets of values. E.g. set FOO_BAR_ENABLED and FOO_BAR_IN_MAIN_MENU as separate flags, not FOO_BAR="enabled" or "FOO_BAR="in_main_menu", as the latter format is more likely to be confused. At the same time, you should check for exact value when checking the flag, to avoid misinterpreting it in the future.

All flags that are set here on the backend will also be set in the featureflags endpoint on the frontend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) string

Get returns the value of a flag, or "" if the flag wasn't set You should use the same behaviour for "flag not set" as you would for "flag set to unknown value", so always check for the exact value.

func GetFlags

func GetFlags() map[string]string

GetFlags returns all featureflags This is only intended to be used by the API to return the flags to the frontend - for all other uses, use `Get`

func Set

func Set(key, value string)

Set sets one specific featureflag Existing flags will be overwritten.

func SetFromEnv added in v0.9.4

func SetFromEnv(envVars []string)

SetFromEnv sets the feature flags from the environment variables

Types

This section is empty.

Jump to

Keyboard shortcuts

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