env

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvMapStr = map[Env]string{
	EnvLocal:       "local",
	EnvDevelopment: "dev",
	EnvTest:        "test",
	EnvPreRelease:  "pre",
	EnvProduction:  "prod",
}

EnvMapStr 环境映射字符串

View Source
var EnvMapSuffixStr = map[Env]string{
	EnvLocal:       "",
	EnvDevelopment: "dev",
	EnvTest:        "test",
	EnvPreRelease:  "pre",
	EnvProduction:  "",
}

EnvMapSuffixStr 环境后缀

View Source
var Getenv string
View Source
var StrMapEnv = map[string]Env{
	"local": EnvLocal,
	"dev":   EnvDevelopment,
	"test":  EnvTest,
	"pre":   EnvPreRelease,
	"prod":  EnvProduction,
}

StrMapEnv 字符串映射环境

Functions

func GetENV

func GetENV() string

func HostIP

func HostIP() string

HostIP 公网ip

func InternalIp

func InternalIp() string

InternalIp 内网ip

func PodName

func PodName() string

func Service

func Service() string

Types

type Env

type Env string

Env 定义环境变量用词

const (
	// EnvLocal 本地调试环境
	EnvLocal Env = "local"
	// EnvDevelopment 开发环境
	EnvDevelopment Env = "dev"
	// EnvTest 测试环境
	EnvTest Env = "test"
	// EnvPreRelease 预发布环境
	EnvPreRelease Env = "pre"
	// EnvProduction 生产环境
	EnvProduction Env = "prod"
)

func Current

func Current() Env

Current 获取当前环境

Jump to

Keyboard shortcuts

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