config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MyInt    int     `json:"myInt" envvar:"MY_INT"`
	MyFloat  float32 `json:"myFloat" envvar:"MY_FLOAT"`
	MyString string  `json:"myString" envvar:"MY_STRING"`
	MyBool   bool    `json:"myBool" envvar:"MY_BOOL"`
	// contains filtered or unexported fields
}

Config is an example struct usable by the cfgbuild package.

func New

func New() (*Config, error)

New will load the .env file env vars (if not already set) and then create and return a new Config based on the env vars.

func (*Config) Init

func (cfg *Config) Init() error

Init sets some default values in the config.

Jump to

Keyboard shortcuts

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