Documentation
¶
Overview ¶
Package cfgmap holds typed accessors for reading values out of the map[string]any config blobs the platform loads from YAML/JSON. YAML and JSON decode into map[string]any with values of varying concrete types (int vs float64, string durations, etc.), so these helpers centralize the type assertions and defaulting used across the platform's config resolution.
Split out of pkg/platform to keep that package under its size budget (#756).
Index ¶
- func Bool(cfg map[string]any, key string) bool
- func BoolDefault(cfg map[string]any, key string, defaultVal bool) bool
- func Duration(cfg map[string]any, key string, defaultVal time.Duration) time.Duration
- func Int(cfg map[string]any, key string, defaultVal int) int
- func String(cfg map[string]any, key string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolDefault ¶
BoolDefault returns the bool value at key, or defaultVal if absent or not a bool. Use this for flags that default to true.
func Duration ¶
Duration returns the duration at key. A string is parsed with time.ParseDuration; a bare number (int or JSON float64) is interpreted as seconds. Returns defaultVal if absent or unparseable.
Types ¶
This section is empty.