parser

package module
v0.0.0-...-5a76b85 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: AGPL-3.0 Imports: 5 Imported by: 0

README

Postfix Log Parser Go Library

pipeline status coverage report report_card scale_index bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

This is an eternal work in progress Postfix Log Parser used by Lightmeter Control Center.

It's very imcomplete as it for now parses only the log types that we use on Lightmeter.

If you have interest on improving it, please send us a PR and check the Lightmeter Contributor agreement in the file CLA.

For licencing information, please check the file LICENSE.

Lightmeter Team https://lightmeter.io

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHeaderLine  = rawparser.ErrInvalidHeaderLine
	ErrUnsupportedLogLine = rawparser.ErrUnsupportedLogLine
)

Functions

func DefaultTimeInYear

func DefaultTimeInYear(year int, tz *time.Location) time.Time

func Fuzz

func Fuzz(data []byte) int

func IsRecoverableError

func IsRecoverableError(err error) bool

func Parse

func Parse(line []byte) (Header, Payload, error)

Types

type Delays

type Delays struct {
	Smtpd   float32
	Cleanup float32
	Qmgr    float32
	Smtp    float32
}
type Header struct {
	Time      Time
	Host      string
	Process   string
	Daemon    string
	PID       int
	ProcessIP net.IP
}

type Payload

type Payload interface {
	// contains filtered or unexported methods
}

type QmgrReturnedToSender

type QmgrReturnedToSender struct {
	Queue            string
	SenderLocalPart  string
	SenderDomainPart string
}

type SmtpSentStatus

type SmtpSentStatus struct {
	Queue               string
	RecipientLocalPart  string
	RecipientDomainPart string
	RelayName           string
	RelayIP             net.IP
	RelayPort           uint16
	Delay               float32
	Delays              Delays
	Dsn                 string
	Status              SmtpStatus
	ExtraMessage        string
}

type SmtpStatus

type SmtpStatus int
const (
	SentStatus     SmtpStatus = 0
	BouncedStatus  SmtpStatus = 1
	DeferredStatus SmtpStatus = 2
)

func (SmtpStatus) String

func (s SmtpStatus) String() string

type Time

type Time struct {
	Month  time.Month
	Day    uint8
	Hour   uint8
	Minute uint8
	Second uint8
}

func (Time) Time

func (t Time) Time(year int, tz *time.Location) time.Time

func (Time) Unix

func (t Time) Unix(year int, tz *time.Location) int64

Follows convention from time.Data():

The month, day, hour, min, sec, and nsec values may be outside their usual ranges
and will be normalized during the conversion. For example, October 32 converts to November 1.

type TimeConverter

type TimeConverter struct {
	// contains filtered or unexported fields
}

func NewTimeConverter

func NewTimeConverter(initialTime time.Time,
	newYearNotifier func(int, Time, Time),
) TimeConverter

func (*TimeConverter) Convert

func (this *TimeConverter) Convert(t Time) time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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