chanio

package module
v0.0.0-...-2e19a45 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2014 License: BSD-3-Clause Imports: 1 Imported by: 0

README

chanio Build Status

The chanio package allows for using the io.Reader, io.Writer, and io.Closer interfaces to interact with byte channels.

See the documentation.

Documentation

Overview

The chanio package allows for using the io.Reader, io.Writer, and io.Closer interfaces to interact with byte channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadWriteCloser

type ReadWriteCloser chan byte

ReadWriteCloser implements the io.ReadWriteCloser interface.

func (ReadWriteCloser) Close

func (r ReadWriteCloser) Close() error

Close closes w. It will never return a non-nil error.

func (ReadWriteCloser) Read

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

Read reads bytes from r into p, blocking until at least 1 byte is available. After that, it reads as many bytes into p as it can without blocking, or until p is full.

If r is closed, Read will return io.EOF. If there are any bytes available to be read from r, it will return those bytes and a nil error, and return io.EOF on the subsequent call.

If len(p) == 0, Read returns 0 and a nil error immediately.

func (ReadWriteCloser) Write

func (r ReadWriteCloser) Write(p []byte) (int, error)

Write writes bytes from p into w, blocking until all bytes have been written. Write will never return a non-nil error.

type Reader

type Reader <-chan byte

Reader implements the io.Reader interface.

func (Reader) Read

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

Read reads bytes from r into p, blocking until at least 1 byte is available. After that, it reads as many bytes into p as it can without blocking, or until p is full.

If r is closed, Read will return io.EOF. If there are any bytes available to be read from r, it will return those bytes and a nil error, and return io.EOF on the subsequent call.

If len(p) == 0, Read returns 0 and a nil error immediately.

type WriteCloser

type WriteCloser chan<- byte

WriteCloser implements the io.WriteCloser interface.

func (WriteCloser) Close

func (w WriteCloser) Close() error

Close closes w. It will never return a non-nil error.

func (WriteCloser) Write

func (w WriteCloser) Write(p []byte) (int, error)

Write writes bytes from p into w, blocking until all bytes have been written. Write will never return a non-nil error.

Jump to

Keyboard shortcuts

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