reader

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 11 Imported by: 82

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 KeyPressReader added in v0.0.17

type KeyPressReader struct {
	Timeout time.Duration

	Once       *sync.Once
	Raw        bool
	BufferSize int
	// contains filtered or unexported fields
}

func (KeyPressReader) Read added in v0.0.17

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

Read into the buffer

func (*KeyPressReader) Start added in v0.0.17

func (reader *KeyPressReader) Start() error

func (*KeyPressReader) Stop added in v0.0.17

func (reader *KeyPressReader) Stop() error

type ReusableReadCloser

type ReusableReadCloser struct {
	*sync.RWMutex
	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

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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