Documentation ¶
Overview ¶
Package configutil contains methods for loading and reading from configuration files, and for reading 'dotenv' files.
Index ¶
Constants ¶
const ( EnvProduction = "production" EnvDevelopment = "development" )
Well-known values for 'GOENV'.
const GoEnvKey = "GOENV"
GoEnvKey is the key for the environmant variable that describes the current environment (i.e. "production", "development").
Variables ¶
This section is empty.
Functions ¶
func GoEnv ¶ added in v0.6.2
func GoEnv() string
GoEnv reteurns the current environment value for 'GOENV'.
func LoadEnv ¶
LoadEnv attempts to loads environment variables from 'dotenv' files, as specified by filenames. If no filenames are given, it will attempt to read '.env' and '.env.local' in the current directory.
It will attempt to load environment variables from all the files in filenames, and will skip missing files.
func LookupGoEnv ¶ added in v0.4.1
LookupGoEnv is like GetEnv, except it additionally returns true if 'GOENV' was set, and false otherwise.
func NewViper ¶ added in v0.5.0
NewViper creates a new Viper that reads from a config file with the provided name, set in a namespace.
Types ¶
This section is empty.