Documentation ¶
Index ¶
- Variables
- func AppPath() string
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func CustomDir() string
- func HomeDir() string
- func Init() error
- func InitCostomConf(customConf string) error
- func IsProdMode() bool
- func IsWindowsRuntime() bool
- func MustAsset(name string) []byte
- func WorkDir() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( App struct { // ⚠️ WARNING: Should only be set by the main package (i.e. "gop2p.go"). Version string `ini:"-"` Name string BrandName string RunUser string RunMode string } Web struct { HttpAddr string `ini:"http_addr"` HttpPort string `ini:"http_port"` HttpServerAddr string `ini:"http_server_addr"` } // log Log struct { Format string RootPath string } Redis struct { Enable bool Address string Password string Bb int Prefix string } Mem struct { CacheChannelTime int64 } Geo struct { Path string } )
View Source
var CustomConf string
CustomConf returns the absolute path of custom configuration file that is used.
View Source
var File *ini.File
File is the configuration object.
Functions ¶
func CustomDir ¶
func CustomDir() string
CustomDir returns the absolute path of the custom directory that contains local overrides. It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work directory returned by WorkDir function.
func HomeDir ¶
func HomeDir() string
HomeDir returns the home directory by reading environment variables. It may return empty string when environment variables are not set.
func InitCostomConf ¶
func IsProdMode ¶
func IsProdMode() bool
IsProdMode returns true if the application is running in production mode.
func IsWindowsRuntime ¶
func IsWindowsRuntime() bool
IsWindowsRuntime returns true if the current runtime in Windows.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.