gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

format.go (452B)


      1 package format
      2 
      3 import (
      4 	"bufio"
      5 	"time"
      6 
      7 	"gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser"
      8 )
      9 
     10 type LogParts map[string]interface{}
     11 
     12 type LogParser interface {
     13 	Parse() error
     14 	Dump() LogParts
     15 	Location(*time.Location)
     16 }
     17 
     18 type Format interface {
     19 	GetParser([]byte) LogParser
     20 	GetSplitFunc() bufio.SplitFunc
     21 }
     22 
     23 type parserWrapper struct {
     24 	syslogparser.LogParser
     25 }
     26 
     27 func (w *parserWrapper) Dump() LogParts {
     28 	return LogParts(w.LogParser.Dump())
     29 }