Documentation
¶
Overview ¶
Package configfile parses and validates YAML flag configuration files. Each file defines flag behavior for a single feature: static values and/or condition chains with CEL expressions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
When string // CEL expression; empty means "otherwise" (default)
Value *pbflagsv1.FlagValue // the value to return when the condition matches
Comment string // annotation from YAML comment (head or inline)
Launch *LaunchOverride // optional launch override (at most one per condition)
}
Condition is one entry in a condition chain.
type Config ¶
type Config struct {
Feature string
Flags map[string]FlagEntry
Launches map[string]LaunchEntry // keyed by launch ID
}
Config is a parsed and validated flag configuration for a single feature.
type FlagEntry ¶
type FlagEntry struct {
Value *pbflagsv1.FlagValue // non-nil for static values
Conditions []Condition // non-nil for condition chains
Launch *FlagLaunchOverride // optional launch override on static value
}
FlagEntry is a single flag's configuration — either a static value or a condition chain, never both.
type FlagLaunchOverride ¶ added in v0.17.0
type FlagLaunchOverride struct {
ID string // launch ID
Value *pbflagsv1.FlagValue // value for entities in the ramp
}
FlagLaunchOverride is a launch override on a static flag value.
type LaunchEntry ¶ added in v0.17.0
type LaunchEntry struct {
Dimension string // hashable dimension to hash on (must be UNIFORM)
RampPercentage int // initial ramp percentage (0-100); only applied on insert, not on update
Description string // optional human-readable description
}
LaunchEntry defines a launch (gradual rollout) at the feature level. The launch-to-flag binding is expressed inline on individual conditions via LaunchOverride on Condition, not on the launch definition.
func ParseCrossFeatureLaunch ¶ added in v0.17.0
func ParseCrossFeatureLaunch(data []byte) (LaunchEntry, error)
ParseCrossFeatureLaunch parses a standalone cross-feature launch YAML file. The launch ID is derived from the filename (sans extension), not from within the file. The file contains only {dimension, ramp_percentage, description}.
type LaunchOverride ¶ added in v0.17.0
type LaunchOverride struct {
ID string // launch ID (must resolve to a defined launch)
Value *pbflagsv1.FlagValue // value to return when the entity is in the launch ramp
}
LaunchOverride is a per-condition value override under a launch.