Documentation ¶
Index ¶
- Constants
- Variables
- func Close()
- func Closed() <-chan bool
- func FileNameInAppDataPath(name string) string
- func FileNameInAppDataPathV2(name string) string
- func FileNameInConfPath(name string) string
- func FileNameInDataPath(name string) string
- func FileNameInEnvDataPath(name string) string
- func FileNameInEnvPath(name string) string
- func FileNameWithEnvInConfAppPath(name string) string
- func FileNameWithEnvInDataPath(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 GetExecPath() string
- func IsDevEnvironment() bool
- func IsProdEnvironment() bool
- func IsTestEnvironment() bool
- func MainFileName() string
- func UseAppDataPathV2()
- func UseDataVersion(ver int)
- func WithEnv(name string) string
- 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 FileNameInDataPath ¶ added in v1.6.11
FileNameInDataPath conf/ 目录下 "{DataPath}/name"
func FileNameInEnvDataPath ¶ added in v1.6.11
FileNameInEnvDataPath conf/ 目录下 "{DataPath}/{Env}/name"
func FileNameInEnvPath ¶ added in v1.1.6
FileNameInEnvPath env/{Env}/name
func FileNameWithEnvInConfAppPath ¶ added in v1.1.6
FileNameWithEnvInConfAppPath conf/appName 带env "conf/{appName}/{Env}.name"
func FileNameWithEnvInDataPath ¶ added in v1.6.11
FileNameWithEnvInDataPath conf/ 目录下 "{DataPath}/{Env}.name"
func FileNameWithoutEnvInConfAppPath ¶ added in v1.1.6
FileNameWithoutEnvInConfAppPath conf/appName 不带env "conf/{appName}/name"
func FileNameWithoutEnvInEnvPath ¶ added in v1.1.6
FileNameWithoutEnvInEnvPath env/name
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 GetExecPath ¶ added in v1.3.20
func GetExecPath() 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()
func UseDataVersion ¶ added in v1.3.19
func UseDataVersion(ver int)
Types ¶
type Config ¶
type Config struct { Mode string `json:"mode" yaml:"mode" xml:"mode"` Server string `json:"server" yaml:"server" xml:"server"` PubIP string `json:"publicIp" yaml:"publicIp" xml:"publicIp"` DataVersion int `json:"dataVersion" yaml:"dataVersion" xml:"dataVersion"` 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.