configfile

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 5 Imported by: 0

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
}

Condition is one entry in a condition chain.

type Config

type Config struct {
	Feature string
	Flags   map[string]FlagEntry
}

Config is a parsed and validated flag configuration for a single feature.

func Parse

func Parse(data []byte, flagTypes map[string]pbflagsv1.FlagType) (*Config, []string, error)

Parse parses a YAML config file and validates it against the given flag type map (flag field name → FlagType). Returns the parsed config, any warnings, and an error if validation fails.

type FlagEntry

type FlagEntry struct {
	Value      *pbflagsv1.FlagValue // non-nil for static values
	Conditions []Condition          // non-nil for condition chains
}

FlagEntry is a single flag's configuration — either a static value or a condition chain, never both.

Jump to

Keyboard shortcuts

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