config

package
v0.9.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEnv

func FromEnv(config interface{}) error

FromEnv reads the config from environment variables and parses them to the `config` interface. The provided interface should be a struct tht has envconfig tags defined.

func FromFile

func FromFile(path string, config interface{}) error

FromFile reads a json config from a file and parses it to the `config` interface. The provided interface should be a struct that has json tags defined. NOTICE: When using a configuration file, the default data from the struct will not work

func InitConfig

func InitConfig(c Configer, path string) error

Types

type Configer

type Configer interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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