示例#1
0
// GetAppEnv gets the AppEnv from the environment.
func GetAppEnv() (AppEnv, error) {
	appEnv := AppEnv{}
	if err := env.Populate(&appEnv); err != nil {
		return AppEnv{}, err
	}
	return appEnv, nil
}
示例#2
0
// GetServeEnv gets a ServeEnv using environment variables.
func GetServeEnv() (ServeEnv, error) {
	var serveEnv ServeEnv
	if err := env.Populate(&serveEnv); err != nil {
		return ServeEnv{}, err
	}
	return serveEnv, nil
}
示例#3
0
// GetHandlerEnv gets the HandlerEnv from the environment.
func GetHandlerEnv() (HandlerEnv, error) {
	handlerEnv := HandlerEnv{}
	if err := env.Populate(&handlerEnv); err != nil {
		return HandlerEnv{}, err
	}
	return handlerEnv, nil
}
示例#4
0
// Setup gets the Env from the environment, and then calls SetupEnv.
func Setup() error {
	appEnv := Env{}
	if err := env.Populate(&appEnv); err != nil {
		return err
	}
	return SetupEnv(appEnv)
}