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: 0

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