package envconfig
import "github.com/kelseyhightower/envconfig"
Package envconfig implements decoding of environment variables based on a user defined specification. A typical use is using environment variables for configuration settings.
Index ¶
- Constants
- Variables
- func MustProcess(prefix string, spec interface{})
- func Process(prefix string, spec interface{}) error
- func Usage(prefix string, spec interface{}) error
- func Usagef(prefix string, spec interface{}, out io.Writer, format string) error
- func Usaget(prefix string, spec interface{}, out io.Writer, tmpl *template.Template) error
- type Decoder
- type ParseError
- type Setter
Constants ¶
const ( DefaultListFormat = "" /* 284 byte string literal not displayed */ DefaultTableFormat = "" /* 258 byte string literal not displayed */ )
Variables ¶
ErrInvalidSpecification indicates that a specification is of the wrong type.
Functions ¶
func MustProcess ¶
func MustProcess(prefix string, spec interface{})
MustProcess is the same as Process but panics if an error occurs
func Process ¶
Process populates the specified struct based on environment variables
func Usage ¶
Usage writes usage information to stderr using the default header and table format
func Usagef ¶
Usagef writes usage information to the specified io.Writer using the specifed template specification
func Usaget ¶
Usaget writes usage information to the specified io.Writer using the specified template
Types ¶
type Decoder ¶
Decoder has the same semantics as Setter, but takes higher precedence. It is provided for historical compatibility.
type ParseError ¶
A ParseError occurs when an environment variable cannot be converted to the type required by a struct field during assignment.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type Setter ¶
Setter is implemented by types can self-deserialize values. Any type that implements flag.Value also implements Setter.
Source Files ¶
doc.go env_syscall.go envconfig.go usage.go
- Version
- v1.3.0
- Published
- Jan 24, 2017
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 12 hours ago –
Tools for package owners.