log_reader

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortResponseTime = "restime"
	SortBodyBytes    = "bytes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	Uri          string
	Method       string
	ResponseTime float64
	BodyBytes    float64
	Status       int
	TimeStr      string
}

func (*AccessLog) UriWithOptions

func (a *AccessLog) UriWithOptions(decode bool) string

type AccessLogReader

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

func NewAccessLogReader

func NewAccessLogReader(outw, errw io.Writer, opts *options.Options, numOfTopN int) *AccessLogReader

func (*AccessLogReader) Append

func (a *AccessLogReader) Append(uri, method, time string, responseTime, bodyBytes float64, status int)

func (*AccessLogReader) Open

func (a *AccessLogReader) Open(filename string) (*os.File, error)

func (*AccessLogReader) OpenPosFile

func (a *AccessLogReader) OpenPosFile(filename string) (*os.File, error)

func (*AccessLogReader) Print

func (a *AccessLogReader) Print()

func (*AccessLogReader) ReadAll

func (a *AccessLogReader) ReadAll(parser parsers.Parser) error

func (*AccessLogReader) ReadPosFile

func (a *AccessLogReader) ReadPosFile(f *os.File) (int, error)

func (*AccessLogReader) SetInReader

func (a *AccessLogReader) SetInReader(f *os.File)

func (*AccessLogReader) Sort

func (a *AccessLogReader) Sort(sortType string, reverse bool) error

func (*AccessLogReader) SortBodyBytes

func (a *AccessLogReader) SortBodyBytes(reverse bool)

func (*AccessLogReader) SortResponseTime

func (a *AccessLogReader) SortResponseTime(reverse bool)

type PrintOptions

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

func NewPrintOptions

func NewPrintOptions(noHeaders, decodeUri bool, paginationLimit int) *PrintOptions

type Printer

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

func NewPrinter

func NewPrinter(w io.Writer, format string, printOptions *PrintOptions) *Printer

func (*Printer) GenerateLine

func (p *Printer) GenerateLine(l *AccessLog, quoteUri bool) []string

func (*Printer) Print

func (p *Printer) Print(logs []*AccessLog)

func (*Printer) SetFormat

func (p *Printer) SetFormat(format string)

func (*Printer) SetHeaders

func (p *Printer) SetHeaders(headers []string)

func (*Printer) SetWriter

func (p *Printer) SetWriter(w io.Writer)

func (*Printer) Validate

func (p *Printer) Validate() error

Jump to

Keyboard shortcuts

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