config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-2-Clause Imports: 4 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) CfgBuildInit added in v0.2.0

func (cfg *Config) CfgBuildInit() error

CfgBuildInit sets some default values in the config. It is called by cfgbuild.Builder.Build().

func (*Config) CfgBuildValidate added in v0.2.0

func (cfg *Config) CfgBuildValidate() error

CfgBuildValidate can check that the certain set values are valid. It is called by cfgbuild.Builder.Build().

Jump to

Keyboard shortcuts

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