feature

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

The feature package provides types and methods for working with feature flags.

Index

Constants

View Source
const (
	Traceroute            = "traceroute"
	K6                    = "k6"
	ExperimentalDnsProber = "experimental-dns-prober"
)

TODO: this doesn't seem like the right place for this

Variables

View Source
var ErrInvalidCollection = errors.New("invalid feature collection")

ErrInvalidCollection is returned when you try to set a flag in an invalid collection.

Functions

This section is empty.

Types

type Collection

type Collection map[string]struct{}

Collection represents a set of feature flags.

func NewCollection

func NewCollection() Collection

NewCollection returns a correctly initialized Collection.

func (Collection) IsSet

func (c Collection) IsSet(name string) bool

IsSet returns true if the provided name is part of the collection, false otherwise.

func (Collection) Set

func (c Collection) Set(s string) error

Set adds the value specified by s to the collection.

The input s can be a single feature flag or multiple feature flags separated by commas.

func (Collection) String

func (c Collection) String() string

String returns an string representation of the collection.

The returned value can be passed to Set to recreate an identical collection.

Jump to

Keyboard shortcuts

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