Documentation ¶
Index ¶
- Constants
- Variables
- func FileNameInAppDataPath(name string) string
- func FileNameInAppDataPathV2(name string) string
- func FileNameInConfPath(name string) string
- func FileNameInEnvPath(name string) string
- func FileNameWithEnvInConfAppPath(name string) string
- func FileNameWithoutEnvInConfAppPath(name string) string
- func FileNameWithoutEnvInEnvPath(name string) string
- func GetAppDataPath() string
- func GetAppDataPathV2() string
- func GetConfAppPath() string
- func GetConfPath() string
- func GetDataPath() string
- func GetEnvPath() string
- func IsDevEnvironment() bool
- func IsProdEnvironment() bool
- func IsTestEnvironment() bool
- func MainFileName() string
- func UseAppDataPathV2()
- func UseDataV2(ver int)
- type Config
Constants ¶
View Source
const ( EProd = "prod" ETest = "test" EDev = "dev" )
View Source
const ( KForever = "forever" KDaemon = "daemon" KPprof = "pprof" KPath = "path" KEnv = "env" KConf = "conf" KDataPath = "dataPath" KAppId = "appid" )
Variables ¶
Functions ¶
func FileNameInAppDataPath ¶ added in v1.2.20
FileNameInAppDataPath 在 conf/ 目录下 "{workdir}/name" 或 {workdir}/app/name
func FileNameInAppDataPathV2 ¶ added in v1.2.20
FileNameInAppDataPathV2 在 conf/ 目录下 "{workdir}/app/name"
func FileNameInConfPath ¶ added in v1.1.6
FileNameInConfPath 在 conf/ 目录下 "confPath/name"
func FileNameInEnvPath ¶ added in v1.1.6
FileNameInEnvPath 在 env/ 目录下,配合环境
func FileNameWithEnvInConfAppPath ¶ added in v1.1.6
FileNameWithEnvInConfAppPath 在 conf/appName 目录下带env "confAppPath/env.name"
func FileNameWithoutEnvInConfAppPath ¶ added in v1.1.6
FileNameWithoutEnvInConfAppPath 在 conf/appName 目录不带env "confAppPath/name"
func FileNameWithoutEnvInEnvPath ¶ added in v1.1.6
func GetAppDataPath ¶ added in v1.1.6
func GetAppDataPath() string
GetAppDataPath 程序运行数据目录,如views,docs
func GetAppDataPathV2 ¶ added in v1.2.20
func GetAppDataPathV2() string
func GetEnvPath ¶ added in v1.1.6
func GetEnvPath() string
func IsDevEnvironment ¶ added in v1.0.51
func IsDevEnvironment() bool
func IsProdEnvironment ¶ added in v1.0.51
func IsProdEnvironment() bool
func IsTestEnvironment ¶ added in v1.0.51
func IsTestEnvironment() bool
func UseAppDataPathV2 ¶ added in v1.1.6
func UseAppDataPathV2()
Types ¶
type Config ¶
type Config struct { LogConfig logger.Config `json:"log" yaml:"log" xml:"log"` Mode string `json:"mode" yaml:"mode" xml:"mode"` Server string `json:"server" yaml:"server" xml:"server"` PubIP string `json:"publicIp" yaml:"publicIp" xml:"publicIp"` AppDataPathV2 bool `json:"appDataPathV2" yaml:"appDataPathV2" xml:"appDataPathV2"` EnabledRedis bool `json:"enabledRedis" yaml:"enabledRedis" xml:"enabledRedis"` EnabledDb bool `json:"enabledDb" yaml:"enabledDb" xml:"enabledDb"` EnabledEs bool `json:"enabledEs" yaml:"enabledEs" xml:"enabledEs"` EnabledMQ bool `json:"enabledMQ" yaml:"enabledMQ" xml:"enabledMQ"` }
Click to show internal directories.
Click to hide internal directories.