Documentation ¶
Overview ¶
Package config defines standard interfaces for a config reader/writer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadOption ¶
type ReadOption func(o *ReadOptions)
ReadOption is a helper setting ReadOptions.
func WithFile ¶ added in v0.0.3
func WithFile(f string) ReadOption
WithFile is an option allow the reader read configuration from a file.
func WithPrefix ¶
func WithPrefix(prefix string) ReadOption
WithPrefix return a with prefix reader option.
type ReadOptions ¶
ReadOptions contains available options of Reader interface.
func (*ReadOptions) Apply ¶
func (op *ReadOptions) Apply(opts ...ReadOption)
Apply applies the given option.
type Reader ¶
type Reader interface { // Read read the configuration into the given struct (ptr). // The provided struct should be a pointer. Read(ptr interface{}, options ...ReadOption) error // Close close the underlying source. Close() error }
Reader is a configuration loader.
Directories ¶
Path | Synopsis |
---|---|
Package envconfig provides a convenient way to load config from environment variables into a struct using https://github.com/kelseyhightower/envconfig.
|
Package envconfig provides a convenient way to load config from environment variables into a struct using https://github.com/kelseyhightower/envconfig. |
Click to show internal directories.
Click to hide internal directories.