lfq

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2023 Matthew Continisio

Copyright 2023 Matthew Continisio

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterProcessor

type FilterProcessor struct {
	Keys []string
}

Filters keys

func (*FilterProcessor) Process

func (p *FilterProcessor) Process(l Line) Line

type JsonReader

type JsonReader struct{}

Read JSON input

func NewJsonReader

func NewJsonReader() *JsonReader

func (*JsonReader) Read

func (r *JsonReader) Read(b []byte) (Line, error)

type JsonWriter

type JsonWriter struct {
	W io.Writer
}

Write JSON output

func NewJsonWriter

func NewJsonWriter() *JsonWriter

func (*JsonWriter) Write

func (w *JsonWriter) Write(l Line) error

type Line

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

A parsed line

func NewLine

func NewLine() Line

type LogfmtReader

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

Read logfmt input

func NewLogfmtReader

func NewLogfmtReader() *LogfmtReader

func (*LogfmtReader) HandleLogfmt

func (r *LogfmtReader) HandleLogfmt(key, val []byte) error

func (*LogfmtReader) Read

func (r *LogfmtReader) Read(b []byte) (Line, error)

type LogfmtWriter

type LogfmtWriter struct {
	W io.Writer

	ForceQuote       bool
	DisableQuote     bool
	QuoteEmptyFields bool
}

Write logfmt output

func NewLogfmtWriter

func NewLogfmtWriter(opts LogfmtWriter) *LogfmtWriter

func (*LogfmtWriter) Write

func (w *LogfmtWriter) Write(l Line) error

type Processor

type Processor interface {
	Process(l Line) Line
}

Processes lines in some way (e.g. filter, transform, etc.)

type Reader

type Reader interface {
	Read(b []byte) (Line, error)
}

Parses bytes into Lines

type ValueWriter

type ValueWriter struct {
	LogfmtWriter
}

Write value-only output

func NewValueWriter

func NewValueWriter(opts LogfmtWriter) *ValueWriter

func (*ValueWriter) Write

func (w *ValueWriter) Write(l Line) error

type Writer

type Writer interface {
	Write(l Line) error
}

Writes lines to stdout

Jump to

Keyboard shortcuts

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