diff options
| author | 2025-03-09 17:47:56 +0100 | |
|---|---|---|
| committer | 2025-12-01 22:08:04 +0100 | |
| commit | b1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch) | |
| tree | 9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go | |
| parent | [chore] update URLs to forked source (diff) | |
| download | gotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz | |
[chore] remove vendor
Diffstat (limited to 'vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go')
| -rw-r--r-- | vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go b/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go deleted file mode 100644 index e0eef9174..000000000 --- a/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go +++ /dev/null @@ -1,45 +0,0 @@ -package format - -import ( - "bufio" - "bytes" - "strconv" - - "gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/rfc5424" -) - -type RFC6587 struct{} - -func (f *RFC6587) GetParser(line []byte) LogParser { - return &parserWrapper{rfc5424.NewParser(line)} -} - -func (f *RFC6587) GetSplitFunc() bufio.SplitFunc { - return rfc6587ScannerSplit -} - -func rfc6587ScannerSplit(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } - - if i := bytes.IndexByte(data, ' '); i > 0 { - pLength := data[0:i] - length, err := strconv.Atoi(string(pLength)) - if err != nil { - if string(data[0:1]) == "<" { - // Assume this frame uses non-transparent-framing - return len(data), data, nil - } - return 0, nil, err - } - end := length + i + 1 - if len(data) >= end { - // Return the frame with the length removed - return end, data[i+1 : end], nil - } - } - - // Request more data - return 0, nil, nil -} |
