reader

package
v0.0.0-...-2b7ea9d Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: CC-BY-SA-4.0, MIT, MIT-0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpectedHeader    = errors.New("expected a header, got something else")
	ErrUnexpectedData    = errors.New("unexpected data length for record type")
	ErrExpectedContinue  = errors.New("expected continue, got other")
	ErrUnexpectedControl = errors.New("unexpected control message")
	ErrUnknownRecordType = errors.New("unknown record type")
	ErrHashMismatch      = errors.New("hash does not match")
	ErrState             = errors.New("tried reading body before you got a header")
)

Functions

This section is empty.

Types

type Reader

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

func NewReader

func NewReader(reader io.Reader) *Reader

func (*Reader) CopyAll

func (reader *Reader) CopyAll(writer io.Writer, validate bool) error

func (*Reader) CopyTo

func (reader *Reader) CopyTo(writer io.Writer, validate bool) error

func (*Reader) GetBody

func (reader *Reader) GetBody(validate bool) ([]byte, error)

func (*Reader) HasBody

func (reader *Reader) HasBody() bool

func (*Reader) Next

func (reader *Reader) Next() (*format.Preamble, interface{}, error)

type ReaderState

type ReaderState int
const (
	STATE_EMPTY ReaderState = 0
	STATE_OK    ReaderState = 1
	STATE_BODY  ReaderState = 2
)

Jump to

Keyboard shortcuts

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