feature

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlag

func BindFlag(set *pflag.FlagSet, flags *Flags)

BindFlag binds the network identifier flag.

func SetGlobals added in v0.12.0

func SetGlobals(flags Flags)

SetGlobals enables all given flags globally.

func WithFlag

func WithFlag(ctx context.Context, flag Flag) context.Context

WithFlag is a convenience function for testing to enable single flags.

func WithFlags

func WithFlags(ctx context.Context, flags Flags) context.Context

WithFlags returns a copy of the context with the given flags enabled. Note that this should only be called once on app startup. Multiple calls will overwrite the existing flags.

Types

type Flag

type Flag string

Flag is a feature flag.

const (
	// FlagFuzzOctane enables fuzz testing of octane.
	FlagFuzzOctane Flag = "fuzz-octane"
)

func (Flag) Enabled

func (f Flag) Enabled(ctx context.Context) bool

Enabled returns true if the flag is enabled in the context or globally.

type Flags

type Flags []string

Flags is a convenience type for a slice of flags providing easy formatting to TOML and usage with spf13 flags.

func (Flags) FormatToml

func (f Flags) FormatToml() string

func (Flags) Typed

func (f Flags) Typed() []Flag

Jump to

Keyboard shortcuts

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