Package syslog provides generic interfaces and structs for syslog messages and transport. Subpackages contains various parsers or scanners for different syslog formats.
Base represents a base struct for syslog messages.
It contains the fields in common among different formats.
ComputeFromPriority set the priority values and computes facility and severity from it.
It does NOT check the input value validity.
FacilityLevel returns the
FacilityMessage returns the text message for the current facility value.
SeverityLevel returns the text level for the current severity value.
SeverityMessage returns the text message for the current severity value.
SeverityShortLevel returns the short text level for the current severity value.
Valid tells whether the receiving message is well-formed or not.
A minimally well-formed RFC3164 syslog message contains at least the priority ([1, 191] or 0). A minimally well-formed RFC5424 syslog message also contains the version.
BestEfforter is an interface that wraps the HasBestEffort method.
Machine represent a FSM able to parse an entire syslog message and return it in an structured way.
MachineOption represents the type of option setters for Machine instances.
Message represent a minimal syslog message.
Parser is an interface that wraps the Parse method.
ParserListener is a function that receives syslog parsing results, one by one.
ParserOption represent the type of option setters for Parser instances.
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.
WithListener returns a generic option that sets the emit function for syslog parsers.
Result wraps the outcomes obtained parsing a syslog message.