Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Filtered = errors.New("filtered")

Functions

func ParseReq added in v1.13.0

func ParseReq(req string) (string, string, string)

Types

type FilterExpr added in v1.9.0

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

func NewFilterExpr added in v1.9.0

func NewFilterExpr(code string) (*FilterExpr, error)

func (*FilterExpr) Run added in v1.9.0

func (f *FilterExpr) Run(entry LogEntry) (bool, error)

type LTSVReadOpt

type LTSVReadOpt struct {
	MatchingGroups []string
	TimeFormat     string
	Labels         map[string]string
	Filter         string
}

type LTSVReader

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

func NewLTSVReader

func NewLTSVReader(r io.Reader, opt LTSVReadOpt) (*LTSVReader, error)

func (*LTSVReader) Parse

func (r *LTSVReader) Parse(entry *LogEntry) (*LogEntry, error)

Parse parses one line of log file into LogEntry struct For reducing memory allocation, you can pass a LogEntry to record to reuse the given one.

func (*LTSVReader) Read

func (r *LTSVReader) Read() bool

type LogEntry

type LogEntry struct {
	Req          string
	Method       string
	Uri          string
	Status       int
	Uid          string
	SetNewUid    bool
	Time         time.Time
	MatchedGroup *regexp.Regexp
}

func (LogEntry) Key

func (e LogEntry) Key() string

Jump to

Keyboard shortcuts

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