예제 #1
0
파일: pkgapp.go 프로젝트: peter-edge/pkg-go
// 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)
}