summaryrefslogtreecommitdiff
path: root/vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-12-12 18:00:20 +0100
committerLibravatar GitHub <noreply@github.com>2021-12-12 18:00:20 +0100
commitc111b239f7d102ac24a79fbef420af46dfec66f9 (patch)
tree813f5c4501a6e5048fb2922e099ce92d35b33b14 /vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go
parentadd systemd service example to packaging (#342) (diff)
downloadgotosocial-c111b239f7d102ac24a79fbef420af46dfec66f9.tar.xz
Add optional syslog logrus hook (#343)
* add optional syslog logrus hook * document syslog
Diffstat (limited to 'vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go')
-rw-r--r--vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go b/vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go
new file mode 100644
index 000000000..f77eb107c
--- /dev/null
+++ b/vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go
@@ -0,0 +1,29 @@
+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())
+}