parser

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser can be used to parse a configuration file and environment into a unified output structure

func NewParser

func NewParser(prefix string) *Parser

NewParser returns a *Parser with the given environment prefix which handles configurations which match the given parseInfos

func (*Parser) Parse

func (p *Parser) Parse(in []byte, v interface{}) error

Parse reads in the given []byte and environment and writes the resulting configuration into the input v

Environment variables may be used to override configuration parameters, following the scheme below: v.Abc may be replaced by the value of PREFIX_ABC, v.Abc.Xyz may be replaced by the value of PREFIX_ABC_XYZ, and so forth

Jump to

Keyboard shortcuts

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