envconfig

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 6 Imported by: 6

Documentation

Overview

Package envconfig provides a convenient way to load config from environment variables into a struct using https://github.com/kelseyhightower/envconfig.

Example
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close close the default config reader.

func Read

func Read(ptr interface{}, opts ...config.ReadOption) error

Read read configuration from environment to the target ptr.

Example (WithOptions)
Output:

Types

type Config

type Config struct {
}

Config implements config.Reader.

func (*Config) Close

func (env *Config) Close() error

Close implements config.Reader interface.

func (*Config) Read

func (env *Config) Read(ptr interface{}, opts ...config.ReadOption) error

Read implements config.Reader interface.

Jump to

Keyboard shortcuts

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