Documentation ¶
Index ¶
Constants ¶
View Source
const ( FrameworkVersion = "1.0.0" HostEnvironment_Windows = "windows" HostEnvironment_Linux = "linux" HostEnvironment_Supervisor = "supervisor" HostEnvironment_Docker = "docker" HostEnvironment_Systemd = "systemd" HostEnvironment_Other = "other" )
View Source
const ( ENV_ConsulPath = "app.abmpconsul.path" ENV_Product = "app.product" ENV_AppName = "app.name" //应用运行目录 ENV_Path = "app.path" //应用名称 ENV_FileName = "app.filename" ENV_IsHostInABMP = "app.isHostInABMP" ENV_Description = "app.description" ENV_StartTime = "app.startTime" //启动app消耗的时间 ENV_StartInterval = "app.startInterval" ENV_AppVersion = "app.appVersion" //abmp框架版本 ENV_FrameworkVersion = "app.frameworkVersion" //应用的运行环境meta key,值主要有windows,linux,supervisor,docker,systemd,other ENV_HostEnvironment = "app.hostEnvironment" ENV_HTTP = "app.http" //公告主机地址 ENV_AdvertiseHost = "app.advertiseHost" //健康检查的地址 ENV_Healthcheck = "app.healthcheck" ENV_Plugininstaller_sourceUrl = "plugininstaller_sourceUrl" ENV_Plugininstaller_feedName = "plugininstaller_feedName" ENV_Plugininstaller_apiKey = "plugininstaller_apiKey" )
常用的环境变量
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IHostEnvironment ¶
type IHostEnvironment interface { GetOS() GOOS_OS GetCurrentPath() string GetExecFileName() string SetProduct(product string) SetAppName(appName string) SetAppVersion(appVersion string) GetHttp() string SetHttp(http string) SetEnv(key string, value interface{}) GetEnv(key string) interface{} GetEnvString(key string) string //设置os环境 变量 SetOSEnv(key string, value string) AllKey() []string }
func GetHostEnvironment ¶
func GetHostEnvironment() IHostEnvironment
func SetupHostEnvironment ¶
func SetupHostEnvironment(opts ...Option) IHostEnvironment
type Option ¶
type Option func(IHostEnvironment)
Click to show internal directories.
Click to hide internal directories.