logparser

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOReader

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

func NewIOReader

func NewIOReader(r io.Reader) IOReader

func (*IOReader) ParsedLog

func (p *IOReader) ParsedLog() ParsedLog

func (*IOReader) Scan

func (p *IOReader) Scan() bool

type JSONParser

type JSONParser struct{}

func (JSONParser) Parse

func (p JSONParser) Parse(line string) (ParsedLog, ResultType)

type ParsedLog

type ParsedLog struct {
	Level     loglevel.Level
	String    string
	Timestamp null.Time
}

func ParseUsingAnyParser

func ParseUsingAnyParser(line string) ParsedLog

type Parser

type Parser interface {
	Parse(line string) (ParsedLog, ResultType)
}

type Reader

type Reader interface {
	Scan() bool
	ParsedLog() ParsedLog
}

type RegExParser

type RegExParser struct {
	Expression     *regexp.Regexp
	TimeLayout     string
	GroupTimestamp int
	GroupLevel     int
}

func (RegExParser) Parse

func (p RegExParser) Parse(line string) (ParsedLog, ResultType)

type ResultType

type ResultType byte
const (
	ResultNoMatch ResultType = iota
	ResultMatch
	ResultMatchMayContinue
)

Jump to

Keyboard shortcuts

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