Documentation
¶
Overview ¶
Package casemap provides utilities for preserving original case of YAML map keys. Viper automatically lowercases all YAML map keys, which breaks case-sensitive configurations like environment variables (e.g., GITHUB_TOKEN becomes github_token). This package extracts original case from raw YAML before Viper processes it, allowing restoration of original key casing when needed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaseMap ¶
CaseMap stores lowercase -> original case mappings for YAML keys. Use this to restore original case after Viper lowercases map keys.
type CaseMaps ¶
type CaseMaps struct {
// contains filtered or unexported fields
}
CaseMaps holds all case mappings for different config paths.
func ExtractFromYAML ¶
ExtractFromYAML extracts case mappings from raw YAML for specified paths. Paths is a list of dot-separated paths, e.g., ["env", "auth.identities"].
func (*CaseMaps) ApplyCase ¶
ApplyCase returns a new map with keys converted to their original case. Keys not in the case map are returned unchanged.