env

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// Dev 开发环境
	Dev = "dev"
	// Test 测试环境
	Test = "test"
	// Prod 生产环境
	Prod = "prod"
)

Variables

This section is empty.

Functions

func GetAppName

func GetAppName() string

GetAppName 可执行文件名

func GetAppPath

func GetAppPath() string

GetAppPath 可执行文件路径

func GetDefaultEtcdAddress

func GetDefaultEtcdAddress() (address []string)

GetDefaultEtcdAddress 返回 etcd 连接地址

func GetEnv

func GetEnv() string

GetEnv 返回当前环境

func Is added in v1.0.5

func Is(env string) bool

Is 返回是否是指定环境 框架定义了四种环境:local、dev、test、prod,这个方法可以判断这四种环境意外的情况

func IsDev

func IsDev() bool

IsDev 返回是否是开发环境

func IsProd

func IsProd() bool

IsProd 返回是否是生产环境

func IsTest

func IsTest() bool

IsTest 返回是否是测试环境

func SetDefaultEtcdAddress

func SetDefaultEtcdAddress(address []string)

SetDefaultEtcdAddress 覆盖全局 etcd 地址

Types

This section is empty.

Jump to

Keyboard shortcuts

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