可配置是否存储连接
This commit is contained in:
@ -38,6 +38,8 @@ const (
|
||||
DefaultLogLevel = zapcore.DebugLevel
|
||||
// DefaultLogSplitInterval 默认的日志切割时间
|
||||
DefaultLogSplitInterval = logger.TimeIntervalTypeHour
|
||||
// DefaultStoreConnection 默认存储连接
|
||||
DefaultStoreConnection = true
|
||||
)
|
||||
|
||||
// WSServerConfig WS-Server的配置
|
||||
@ -53,6 +55,7 @@ type WSServerConfig struct {
|
||||
LogFile string // 日志文件名
|
||||
LogLevel zapcore.Level // 日志等级
|
||||
LogSplitInterval logger.TimeIntervalType // 日至切割的时间间隔
|
||||
StoreConnection bool // 存储连接
|
||||
}
|
||||
|
||||
// SetWSServerConfig 设置WS-Server的配置
|
||||
@ -85,6 +88,17 @@ func SetWSServerLogEnable(logPath string, logFile string, logLevel zapcore.Level
|
||||
}
|
||||
}
|
||||
|
||||
// DisableStoreConnection 禁用连接存储
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// Date : 11:10 下午 2021/4/17
|
||||
func DisableStoreConnection() SetWSServerConfig {
|
||||
return func(wsc *WSServerConfig) {
|
||||
wsc.StoreConnection = true
|
||||
}
|
||||
}
|
||||
|
||||
// NewWSServerConfig 生成新的WS-Server配置
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
|
Reference in New Issue
Block a user