Documentation ¶
Index ¶
- Variables
- func IsModeDebug() bool
- func IsModeDev() bool
- func IsModeProd() bool
- func LoadConfig(filename string) error
- func RegisterViperDefault(f ...func())
- func SetupConfig(path string)
- func SetupLogger()
- func ViperGops() agent.Options
- func ViperInitDefault()
- func ViperLogger() izap.Config
- func ViperLoggerDefault()
- type Application
Constants ¶
This section is empty.
Variables ¶
View Source
var AntsPool, _ = ants.NewPool(500000)
AntsPool ants pool instance
View Source
var AppConfig = new(Application)
Functions ¶
func IsModeDebug ¶
func IsModeDebug() bool
func IsModeProd ¶
func IsModeProd() bool
func RegisterViperDefault ¶
func RegisterViperDefault(f ...func())
RegisterViperDefaultFunc 增加设置viper默认值回调
func SetupLogger ¶
func SetupLogger()
func ViperLogger ¶
func ViperLoggerDefault ¶
func ViperLoggerDefault()
Types ¶
type Application ¶
type Application struct { Mode string // 工作模式 Name string // 应用名称 Host string // 主机名 Port string // 端口 ReadTimeout int // 读超时 WriterTimeout int // 写超时 }
func ViperApplication ¶
func ViperApplication() *Application
func (Application) Addr ¶
func (sf Application) Addr() string
Click to show internal directories.
Click to hide internal directories.