configuration

package
v0.0.0-...-e48215e Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(v Validator, configName string, defaultValues map[string]string) error

ReadConfig reads the TOML configuration file in predefined standard paths into v, returns an error if v.Validate() returns error, or some configuration file reading error happens. v is the destination struct, configName is the name used for the configuration file. ReadConfig will not return an error for missing configuration file, since the fields contained in v can be also read from environment variables.

Types

type Validator

type Validator interface {
	Validate() error
}

Validator is an object that implements a validation method, which accepts no argument and returns an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳