config

package
v0.0.0-...-0d96ec3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Server serverConf
	Db     dbConf
	Logger loggerConf
}

Conf is the parent struct which holds the children configuration structs. Conf is used to keep config structs in isolated logical groups.

func AppConfig

func AppConfig() *Conf

AppConfig runs the setup and install of the applications' configuration variables AppConfig is called wherever the config data is required.

Example
type exampleStruct struct {
	String string `env:"STRING"`
}
os.Setenv("STRING", "an example string!")

var e exampleStruct
err := envdecode.StrictDecode(&e)
if err != nil {
	panic(err)
}

// if STRING is set, e.String will contain its value
fmt.Println(e.String)
Output:

an example string!

Jump to

Keyboard shortcuts

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