Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(dir ...string) string
- func Close(force bool)
- func Debug() bool
- func Dir() string
- func Name() string
- func On(e EventType, f EventFunc)
- func Range(f func(IModule) bool)
- func Reload()
- func SIGHUP()
- func SetBanner(f func())
- func SetProcess(f func() bool)
- func Start(waitForSystemExit bool, mods ...IModule)
- func Use(mods ...IModule)
- func WaitForSystemExit()
- type EventFunc
- type EventType
- type IModule
- type Module
Constants ¶
View Source
const ( AppDir string = "dir" //工作目录 AppName string = "name" AppPprof string = "pprof" AppDebug string = "debug" AppConfigNamePidFile string = "pid" //pid file dir AppConfigNameLogsPath string = "logs.path" //logs dir AppConfigNameLogsLevel string = "logs.level" //logs level AppConfigNameDaemonize string = "daemonize" //后台运行 AppConfigNameConfigFileExt string = "ConfigFileExt" //config file default ext name,只能在程序中设置 AppConfigNameConfigFileName string = "config" //config file )
Variables ¶
View Source
var Config = &config{Viper: viper.New()}
View Source
var GCSummaryTime time.Duration = time.Second * 300
GCSummaryTime 报告性能摘要时间间隔
View Source
var Options = &struct { Banner func() Process func() bool //设置启动进程,返回false时不会继续向下执行 }{ Banner: defaultBanner, }
View Source
var SignalReload syscall.Signal = 10
SignalReload 重新加载系统信号 kill -10 pid
View Source
var Version string = "unknown"
Functions ¶
func SetProcess ¶
func SetProcess(f func() bool)
func WaitForSystemExit ¶
func WaitForSystemExit()
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.