linereader

package
v0.0.0-...-2560197 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineReader

type LineReader struct {
	C chan []byte
}

LineReader reads lines from an io.Reader and passes them to a channel.

func New

func New() *LineReader

New constructs a new LineReader. While the zero value is usable, it may cause a race condition; it is better to call New() to initialize the channel before calling ReadLines, to ensure that the channel is not nil when it is first read.

func (*LineReader) ReadLines

func (r *LineReader) ReadLines(in io.Reader) (err error)

ReadLines continuously reads lines from the Reader and sends them on C. It will not return until it encounters an error (including io.EOF).

Jump to

Keyboard shortcuts

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