reader

package
v0.0.58 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 11 Imported by: 37 modules, 119 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

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
keypress/raw command

Jump to

Keyboard shortcuts

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