Documentation
¶
Index ¶
Constants ¶
const ParserFormat string = "VARENV"
ParserFormat defines the standard identifier used to identify system environment variables.
const XERR_PKGCTX_PARSER xerrors.ErrorCode = "XCONFIG.PARSER.VARENV"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser implements the xconfig.Parser interface to read, filter, and map system environment variables into a consolidated application state.
func NewParser ¶
func NewParser() *Parser
NewParser instantiates an unconfigured pointer to an environment variables Parser.
func (*Parser) Read ¶
Read intercepts all active system environment variables, filters out keys that do not match the configured application prefix, strips the prefix, and normalizes the hierarchical separators into standard dot-notation format.
Processing features:
- Trims the mandatory application prefix to clean up the configuration map keys.
- Automatically handles boundary separators to avoid leading dots (e.g., converts APP_DB to db).
- Replaces custom layout delimiters with dot notation (e.g., DB_PORT becomes db.port).
Returns a generic string-interface map containing all parsed and matched environment data.