Documentation
¶
Overview ¶
Package flags provides a small, in-memory set of boolean feature flags.
Flags are explicit application state: create a Set during startup, pass it to the components that need it, and update it at runtime with Set. The package does not provide global state or persistence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a concurrency-safe collection of boolean feature flags.
The zero value is ready to use. A nil *Set behaves like an empty set when queried with Enabled.
func New ¶
New returns a Set with names enabled. Empty names are ignored and surrounding whitespace is trimmed.
func Parse ¶
Parse returns a Set containing the enabled names in a comma-separated string. Empty items are ignored and surrounding whitespace is trimmed.
func (*Set) Enabled ¶
Enabled reports whether name is enabled. It returns false for an empty name or a nil receiver.