ircreader

package
v0.0.0-...-f5e0f87 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadQ = errors.New("readQ exceeded (read too many bytes without terminating newline)")
)

Functions

This section is empty.

Types

type Reader

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

func NewIRCReader

func NewIRCReader(conn io.Reader) *Reader

Returns a new *Reader with sane buffer size limits.

func (*Reader) Initialize

func (cc *Reader) Initialize(conn io.Reader, initialSize, maxSize int)

"Placement new" for a Reader; initializes it with custom buffer size limits.

func (*Reader) ReadLine

func (cc *Reader) ReadLine() ([]byte, error)

Blocks until a full IRC line is read, then returns it. Accepts either \n or \r\n as the line terminator (but not \r in isolation). Passes through errors from the underlying connection. Returns ErrReadQ if the buffer limit was exceeded without a terminating \n.

Jump to

Keyboard shortcuts

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