rfc3164

package
v1.5.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const PRI_MAX_LEN = 3

Variables

View Source
var VALID_TIMESTAMPS = []string{
	time.RFC3339,
	"Jan 02 15:04:05 2006",
	"Jan _2 15:04:05 2006",
	"Jan 02 15:04:05",
	"Jan _2 15:04:05",
}

Order is important: format with the most information must be first because we will stop on the first match

Functions

This section is empty.

Types

type RFC3164

type RFC3164 struct {
	PRI       int
	Timestamp time.Time
	Hostname  string
	Tag       string
	Message   string
	PID       string
	// contains filtered or unexported fields
}

func NewRFC3164Parser

func NewRFC3164Parser(opts ...RFC3164Option) *RFC3164

func (*RFC3164) Parse

func (r *RFC3164) Parse(message []byte) error

type RFC3164Option

type RFC3164Option func(*RFC3164)

func WithCurrentYear

func WithCurrentYear() RFC3164Option

func WithStrictHostname

func WithStrictHostname() RFC3164Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL