add recorder for serial handler
This commit is contained in:
@ -49,6 +49,10 @@ const (
|
||||
mdKeyPostUp = "postUp"
|
||||
mdKeyPostDown = "postDown"
|
||||
mdKeyIgnoreChain = "ignoreChain"
|
||||
|
||||
mdKeyRecorderDirection = "direction"
|
||||
mdKeyRecorderTimestampFormat = "timeStampFormat"
|
||||
mdKeyRecorderHexdump = "hexdump"
|
||||
)
|
||||
|
||||
func ParseAuther(cfg *config.AutherConfig) auth.Authenticator {
|
||||
@ -492,6 +496,14 @@ func ParseRecorder(cfg *config.RecorderConfig) (r recorder.Recorder) {
|
||||
)
|
||||
}
|
||||
|
||||
if cfg.TCP != nil && cfg.TCP.Addr != "" {
|
||||
return xrecorder.TCPRecorder(cfg.TCP.Addr, xrecorder.TimeoutTCPRecorderOption(cfg.TCP.Timeout))
|
||||
}
|
||||
|
||||
if cfg.HTTP != nil && cfg.HTTP.URL != "" {
|
||||
return xrecorder.HTTPRecorder(cfg.HTTP.URL, xrecorder.TimeoutHTTPRecorderOption(cfg.HTTP.Timeout))
|
||||
}
|
||||
|
||||
if cfg.Redis != nil &&
|
||||
cfg.Redis.Addr != "" &&
|
||||
cfg.Redis.Key != "" {
|
||||
|
Reference in New Issue
Block a user