Documentation
¶
Index ¶
- func AppendUnique(list []string, item string) []string
- func Bool(cfg map[string]any, key string, fallback bool) bool
- func CamelAlias(snake string) string
- func DefaultsFromFields(raw []byte) (map[string]any, error)
- func FieldNames(raw []byte) ([]string, error)
- func Float(cfg map[string]any, key string, fallback float64) float64
- func Int(cfg map[string]any, key string, fallback int) int
- func ResolveAliases(defaults, userCfg map[string]any) (map[string]any, []string)
- func String(cfg map[string]any, key, fallback string) string
- func StringSlice(cfg map[string]any, key string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUnique ¶
AppendUnique appends item to list only if it is not already present.
func CamelAlias ¶ added in v1.2.0
CamelAlias returns the deprecated camelCase spelling of a snake_case config key (show_tooltip -> showTooltip), or "" when the key contains no underscore and therefore has no distinct alias.
func DefaultsFromFields ¶ added in v1.0.0
DefaultsFromFields extracts the default values from blueprint-style YAML of the shape fields: {name: {type, label, hint, default, min, max}}. Shared by the clientplugins manifest defaults and external plugin blueprints.
func FieldNames ¶ added in v1.2.0
FieldNames extracts every declared field name from blueprint-style YAML, sorted. Unlike DefaultsFromFields it includes fields that declare no default, so key validation does not treat a default-less field as unknown.
func Float ¶ added in v1.2.0
Float reads a float64 from a plugin config map with a fallback default.
func ResolveAliases ¶ added in v1.2.0
ResolveAliases re-keys deprecated camelCase spellings in userCfg to their canonical snake_case names, taken from the keys of defaults. When both spellings are present the canonical one wins; the alias is still reported in used. Keys that are neither canonical nor a known alias pass through unchanged. used is sorted for deterministic output.
Types ¶
This section is empty.