reader

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Ts          time.Time   // timestamp the content was read
	Content     []byte      `json:"content"`         // actual content read
	Bytes       int         `json:"bytes,omitempty"` // total number of bytes read to generate the message
	Fields      util.MapStr // optional fields that can be added by reader
	Meta        util.MapStr // deprecated
	LineNumbers []int64     `json:"line_numbers"` // line numbers of current content
	Offset      int64       `json:"offset"`       // content offset in file
}

func (*Message) AddFields

func (m *Message) AddFields(fields util.MapStr)

AddFields adds fields to the message.

func (*Message) AddFlagsWithKey

func (m *Message) AddFlagsWithKey(key string, flags ...string) error

AddFlagsWithKey adds flags to the message with an arbitrary key. If the field does not exist, it is created.

func (*Message) IsEmpty

func (m *Message) IsEmpty() bool

IsEmpty returns true in case the message is empty A message with only newline character is counted as an empty message

type Reader

type Reader interface {
	io.Closer
	Next() (Message, error)
}

Directories

Path Synopsis
dtfmt
Package dtfmt provides time formatter support with pattern syntax mostly similar to joda DateTimeFormat.
Package dtfmt provides time formatter support with pattern syntax mostly similar to joda DateTimeFormat.
streambuf
Package streambuf provides helpers for buffering multiple packet payloads and some general parsing functions.
Package streambuf provides helpers for buffering multiple packet payloads and some general parsing functions.

Jump to

Keyboard shortcuts

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