// GetHandlerEnv gets the HandlerEnv from the environment.
519941
func GetHandlerEnv() (HandlerEnv, error) {
	handlerEnv := HandlerEnv{}
	if err := env.Populate(&handlerEnv); err != nil {
		return HandlerEnv{}, err
	}
	return handlerEnv, nil
}
1192175
func (c *Configuration) CheckEnv() error {
	if c.ActiveEnv == "" {
		return fmt.Errorf("No active environment chosen. Please choose an environment using the \"env\" flag in config.toml or the $%s_ENV environment variable", c.AppEnvName)
	}
	return nil
}
414334
func getenvEitherCase(k string) string {
	if v := os.Getenv(strings.ToUpper(k)); v != "" {
		return v
	}
	return os.Getenv(strings.ToLower(k))
}
707569
func Getenv(ctx context.Context, key string) string {
	val, _ := LookupEnv(ctx, key)
	return val
}
35437
func GetEnvValueStrict(key string) (string, error) {
	if val := os.Getenv(key); len(val) != 0 {
		return strings.TrimSpace(val), nil
	}

	return "", fmt.Errorf("env variable %s is not set", key)
}
416635
func checkEnvVars(envVars ...string) *string {
	var res string
	for _, envVar := range envVars {
		v, isSet := os.LookupEnv(envVar)

		// If we don't explicitly opt out from unit tests
		// by specifying F8_RESOURCE_UNIT_TEST=0
		// we're going to run them
		if !isSet && envVar == UnitTest {
			continue
		}

		// Skip test if environment variable is not set.
		if !isSet {
			res = fmt.Sprintf(StSkipReasonNotSet, envVar)
			return &res
		}
		// Try to convert to boolean value
		isTrue, err := strconv.ParseBool(v)
		if err != nil {
			res = fmt.Sprintf(StSkipReasonParseError, envVar, v)
			return &res
		}

		if !isTrue {
			res = fmt.Sprintf(StSkipReasonValueFalse, envVar, v)
			return &res
		}
	}
	return nil
}
1327531
func getDurationEnvVar(envVar string, def *time.Duration) *time.Duration {
	if strVal := os.Getenv(envVar); strVal != "" {
		if dur, err := time.ParseDuration(strVal); err == nil {
			return &dur
		}
	}
	return def
}
608284
func (env *OsEnvReader) LookupEnv(key string) (string, bool) {
	return env.lookup(key)
}
169113
func NewEnv(v interface{}) (*Env, error) {
	e := &Env{}

	if reflect.TypeOf(v).Kind() != reflect.Ptr {
		return nil, errInvalidValue
	}
	if reflect.ValueOf(v).Elem().Kind() != reflect.Struct {
		return nil, errInvalidValue
	}

	e.SetValue(v)

	if err := e.Parse(); err != nil {
		return e, err
	}

	return e, nil
}
1360882
func (logger *Logger) GetHandler(name string) Handler {
	logger.mutex.RLock()
	handlerSpec := logger.eventHandlerMap[name]
	logger.mutex.RUnlock()

	if handlerSpec == nil {
		return nil
	}
	return handlerSpec.handler
}
1221148
func Env(e *Config) Option {
	return func(o *options) {
		o.env = append(o.env, e)
	}
}
1151108
func (h *HTTPHandlerSwitcher) GetHandler() (newHandler http.Handler) {
	handler := h.handler.Get().(http.Handler)
	return handler
}
555783
func GetHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
	defer r.Body.Close()
	vars := mux.Vars(r)
	return getHandler(ctx, w, r, vars)
}
543086
func getUint64EnvVar(envVar string, def *uint64) *uint64 {
	if strVal := os.Getenv(envVar); strVal != "" {
		if parsedVal, err := strconv.ParseUint(strVal, 10, 64); err == nil {
			return &parsedVal
		}
	}
	return def
}
1371916
func FromEnvP(env string, value interface{}) interface{} {
	ev, err := FromEnv(env, value)
	if err != nil {
		panic(err)
	}
	return ev
}
391608
func getVar(envVal string, def string) string {
	var ret string
	ret = os.Getenv(envVal)
	if ret == "" {
		ret = def
	}
	return ret
}
419790
func GetEnviron(st EnvironConfigGetter, newEnviron NewEnvironFunc) (Environ, error) {
	env, _, err := GetEnvironAndCloud(st, newEnviron)
	return env, err
}