env

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvOrDefault

func GetEnvOrDefault(envName, defaultValue string) string

GetEnvOrDefault 获取环境变量值。 成功获取到,则返回具体值;若无法获取或获取到空,则返回 defaultValue。

func VerifyConfig

func VerifyConfig()

VerifyConfig 校验系统必备的配置信息

Types

type RuntimeEnv

type RuntimeEnv string
const (
	Production  RuntimeEnv = "production"
	Development RuntimeEnv = "development"
	Test        RuntimeEnv = "test"
	Unset       RuntimeEnv = ""
)

运行环境定义

func GetRuntimeEnv

func GetRuntimeEnv() RuntimeEnv

GetRuntimeEnv 获取当前环境 默认为生产(production),指定环境为开发(development),测试(test)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL