env

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

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 IsDev

func IsDev() bool

IsDev 返回是否是开发环境

func IsLocal

func IsLocal() bool

IsLocal 返回是否是本地环境

func IsProd

func IsProd() bool

IsProd 返回是否是生产环境

func IsTest

func IsTest() bool

IsTest 返回是否是测试环境

func SetDefaultEtcdAddress

func SetDefaultEtcdAddress(address []string)

SetDefaultEtcdAddress 覆盖全局 etcd 地址

Types

type ENV

type ENV string

ENV 环境

const (
	// Local 本地环境
	Local ENV = "local"
	// Dev 开发环境
	Dev ENV = "dev"
	// Test 测试环境
	Test ENV = "test"
	// Prod 生产环境
	Prod ENV = "prod"
)

func GetEnv

func GetEnv() ENV

GetEnv 返回当前环境

Jump to

Keyboard shortcuts

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