File: options.go

package info (click to toggle)
golang-github-influxdata-go-syslog 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 964 kB
  • sloc: makefile: 84
file content (19 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package syslog

// WithListener returns a generic option that sets the emit function for syslog parsers.
func WithListener(f ParserListener) ParserOption {
	return func(p Parser) Parser {
		p.WithListener(f)
		return p
	}
}

// WithBestEffort returns a generic options that enables best effort mode for syslog parsers.
//
// When passed to a parser it tries to recover as much of the syslog messages as possible.
func WithBestEffort() ParserOption {
	return func(p Parser) Parser {
		p.WithBestEffort()
		return p
	}
}