stream

package
v0.0.0-...-eb16fb7 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Raw  []byte
	JSON json.RawMessage

	Prefix []byte
	Suffix []byte
}

Line represents a line from the given Reader of a Stream, containing the raw bytes and the RawMessage of JSON if present.

type Stream

type Stream interface {
	Close()
	Lines() <-chan *Line
	Err() error
}

Stream lets you scan through the lines of a io.Reader and return each line as a Line struct, containing the raw bytes and the JSON bytes if present. Lines parsed are exposed byt the Lines() method.

func New

func New(r io.Reader) Stream

New will construct a new Stream and start it.

Jump to

Keyboard shortcuts

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