reader

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 8 Imported by: 75

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("Timeout")

Functions

This section is empty.

Types

type FrozenReader

type FrozenReader struct{}

FrozenReader is a reader that never returns

func (FrozenReader) Read

func (reader FrozenReader) Read(p []byte) (n int, err error)

Read into the buffer

type ReusableReadCloser

type ReusableReadCloser struct {
	io.Reader
	// contains filtered or unexported fields
}

ReusableReadCloser is a reusable reader with no-op close

func NewReusableReadCloser

func NewReusableReadCloser(raw interface{}) (*ReusableReadCloser, error)

NewReusableReadCloser is returned for any type of input

func (ReusableReadCloser) Close

func (r ReusableReadCloser) Close() error

Close is a no-op close of ReusableReadCloser

func (ReusableReadCloser) Read

func (r ReusableReadCloser) Read(p []byte) (int, error)

Read []byte from Reader

type TimeoutReader

type TimeoutReader struct {
	Timeout time.Duration
	Reader  io.Reader
	// contains filtered or unexported fields
}

TimeoutReader is a reader wrapper that stops waiting after Timeout

func (TimeoutReader) Read

func (reader TimeoutReader) Read(p []byte) (n int, err error)

Read into the buffer

Jump to

Keyboard shortcuts

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