env

package
v0.0.5-beta Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NNClusterType = "NN_CLUSTER_TYPE"
	DockAppName   = "APP_NAME"
	DockerRunEnv  = "RUN_ENV"
)
View Source
const (
	RunEnvDEV = 0
	RunEnvQAT = 1
	RunEnvPRE = 2
	RunEnvPRD = 3
	RunEnvDOC = 4
)

RUN_ENV: (prod,tips,test)

View Source
const DefaultRootPath = "."
View Source
const LogLevel = "LOG_LEVEL"

Variables

View Source
var (
	LocalIP  string
	AppName  string
	RunMode  string
	ServerID 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

func GetLogLevel

func GetLogLevel() string

func GetRootPath

func GetRootPath() string

func GetRunEnv

func GetRunEnv() int

func GetServerID

func GetServerID() string

func IsDockerPlatform

func IsDockerPlatform() bool

func IsEncrypted

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

func SetAppName

func SetAppName(appName string)

func SetRootPath

func SetRootPath(r string)

SetRootPath 设置应用的根目录

func SetServerID

func SetServerID(serverID string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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