env

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SubConfDefault = ""
	SubConfMount   = "mount"
	SubConfApp     = "app"
)
View Source
const (
	// 容器中的环境变量
	CsseClusterType = "CSSE_CLUSTER_TYPE"
	DockAppName     = "APP_NAME"
	DockerRunEnv    = "RUN_ENV"
)
View Source
const (
	RunEnvTest   = 0
	RunEnvTips   = 1
	RunEnvOnline = 2
)

RUN_ENV: (prod,tips,test)

View Source
const DefaultRootPath = "."

Variables

View Source
var (
	LocalIP string
	AppName string
	RunMode string

	Hostname string
)

Functions

func CommonSecretChange

func CommonSecretChange(prefix string, src, dst interface{})

目前只支持替换为string类型的value

func DecodeDBSensitiveField

func DecodeDBSensitiveField(encrypted string) string

func EncodeDBSensitiveField

func EncodeDBSensitiveField(plainText string) string

func GetAppName

func GetAppName() string

func GetConfDirPath

func GetConfDirPath() string

GetConfDirPath 返回配置文件目录绝对地址

func GetLogDirPath

func GetLogDirPath() string

LogRootPath 返回log目录的绝对地址

func GetRootPath

func GetRootPath() string

RootPath 返回应用的根目录

func GetRunEnv

func GetRunEnv() int

func IsDockerPlatform

func IsDockerPlatform() bool

判断项目运行平台:容器 vs 开发环境

func IsEncrypted

func IsEncrypted(data string) (isEncrypted bool, err error)

func LoadConf

func LoadConf(filename, subConf string, s interface{})

func SetAppName

func SetAppName(appName string)

开发环境可手动指定SetAppName

func SetRootPath

func SetRootPath(r string)

SetRootPath 设置应用的根目录

Types

This section is empty.

Jump to

Keyboard shortcuts

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