liner

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package liner handles reading lines from clients that may or may not require continuation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Line

type Line struct {
	Line     []byte
	Literals map[string][]byte
}

type Liner

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

func New

func New(r io.Reader) *Liner

func (*Liner) Lines

func (l *Liner) Lines(doContinuation func() error) <-chan Line

Lines returns a channel that will receive lines as they are read.

func (*Liner) Read

func (l *Liner) Read(doContinuation func() error) ([]byte, map[string][]byte, error)

Read reads a full line, automatically reading again if the line was not complete. Each time an additional read is performed, doContinuation is called. If the callback returns an error, the operation is aborted.

func (*Liner) Reset

func (l *Liner) Reset(r io.Reader)

Reset resets the liner to read from a new reader.

Jump to

Keyboard shortcuts

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