Documentation ¶
Overview ¶
The feature package provides types and methods for working with feature flags.
Index ¶
Constants ¶
const ( Traceroute = "traceroute" AdHoc = "adhoc" K6 = "k6" )
TODO: this doesn't seem like the right place for this
Variables ¶
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.