Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddViperUnmarshal ¶
func AddViperUnmarshal(fileName string, conf IConfig, onChange OnConfigChangeFn, decoderConfigOpts ...viper.DecoderConfigOption)
Types ¶
type AppConfImpl ¶
type AppConfImpl struct { FileName string AppPath string Port int Logging *LoggingOpt Cors *CorsOpt ErrorCatch *ErrorCatchOpt RspCueTpl *RspCueTplOpt // http响应结构的cue模板 }
var AppConf AppConfImpl
AppConf 配置中心
func (*AppConfImpl) InitDefaultConfig ¶
func (this *AppConfImpl) InitDefaultConfig(vp *viper.Viper)
type ErrorCatchOpt ¶
type ErrorCatchOpt struct {
Enable bool
}
type LogFileOpt ¶
type LoggingOpt ¶
type LoggingOpt struct { RequestLogEnable bool // 是否开启http访问日志 LogAccess *LogFileOpt LogError *LogFileOpt }
type OnConfigChangeFn ¶
type OnConfigChangeFn func(vp *viper.Viper) OnConfigChangeRunFn
type OnConfigChangeRunFn ¶
type RspCueTplOpt ¶ added in v1.0.9
type RspCueTplOpt struct {
ErrorTpl string // 错误的cue模板
}
Click to show internal directories.
Click to hide internal directories.