mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-30 07:32:45 +00:00
30 lines
452 B
Go
30 lines
452 B
Go
|
package format
|
||
|
|
||
|
import (
|
||
|
"bufio"
|
||
|
"time"
|
||
|
|
||
|
"gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser"
|
||
|
)
|
||
|
|
||
|
type LogParts map[string]interface{}
|
||
|
|
||
|
type LogParser interface {
|
||
|
Parse() error
|
||
|
Dump() LogParts
|
||
|
Location(*time.Location)
|
||
|
}
|
||
|
|
||
|
type Format interface {
|
||
|
GetParser([]byte) LogParser
|
||
|
GetSplitFunc() bufio.SplitFunc
|
||
|
}
|
||
|
|
||
|
type parserWrapper struct {
|
||
|
syslogparser.LogParser
|
||
|
}
|
||
|
|
||
|
func (w *parserWrapper) Dump() LogParts {
|
||
|
return LogParts(w.LogParser.Dump())
|
||
|
}
|