featureset

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package featureset defines a set of global features and their rollout status.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableForT

func DisableForT(t *testing.T, feature Feature)

DisableForT disables a feature for testing.

func EnableForT

func EnableForT(t *testing.T, feature Feature)

EnableForT enables a feature for testing.

func Enabled

func Enabled(feature Feature) bool

Enabled returns true if the feature is enabled.

func Init

func Init(ctx context.Context, config Config) error

Init initialises the global feature set state.

Types

type Config

type Config struct {
	// MinStatus defines the minimum enabled status.
	MinStatus string
	// Enabled overrides min status and enables a list of features.
	Enabled []string
	// Disabled overrides min status and disables a list of features.
	Disabled []string
}

Config configures the feature set package.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default config enabling only stable features.

type Feature

type Feature string

Feature is a feature being rolled out.

const (
	// QBFTConsensus introduces qbft consensus, see https://github.com/ObolNetwork/charon/issues/445.
	QBFTConsensus Feature = "qbft_consensus"
	// Priority enables the infosync component using the priority protocol.
	Priority Feature = "priority"
	// MockAlpha is a mock feature in alpha status for testing.
	MockAlpha Feature = "mock_alpha"

	// RelayDiscovery enables relay peer discovery and disables discv5:
	//   - If a direct connection to a peer is not possible then try to connect to it via all the provided bootnodes/relays.
	//   - Direct connections are either not possible since no addresses are known or the addresses do not work.
	//   - When connected via relay, libp2p's identify protocol detects the remote peer's addresses.
	//   - Those are added to the peer store so libp2p will try to use them.
	RelayDiscovery Feature = "relay_discovery"
)

Jump to

Keyboard shortcuts

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