Documentation
¶
Overview ¶
Package iobus converts an io.Reader or io.Writer to a chan []byte.
Index ¶
- Variables
- func NewWriter(w io.Writer) (chan<- []byte, <-chan error)
- func Writer(w io.Writer, ch <-chan []byte, errCh chan<- error)
- type Config
- func (cfg Config) NewReadWriter(rw io.ReadWriter) *ReadWriter
- func (cfg Config) NewReader(r io.Reader) *Reader
- func (cfg Config) NewWriter(w io.Writer) (chan<- []byte, <-chan error)
- func (cfg Config) Reader(r io.Reader, ch chan<- []byte, errCh chan<- error, stop *bool)
- func (cfg Config) Writer(w io.Writer, ch <-chan []byte, errCh chan<- error)
- type Duplex
- type ReadWriter
- type Reader
Constants ¶
This section is empty.
Variables ¶
View Source
var BufSize uint = 512
BufSize is the default buffer size that will be used if BufSize is not explicitly set on a Reader.
Functions ¶
Types ¶
type Config ¶
type Config struct { // CloseOnEOF causes a reader to close when it receives and EOF CloseOnEOF bool // Buffer size to use BufSize int // MakeErrCh is used by NewReader and NewWriter to set if an error channel // should be created. MakeErrCh bool // Sleep determines how long to wait before reading again after an empty // read. Sleep time.Duration }
Config sets operational details for a Bus.
func (Config) NewReadWriter ¶
func (cfg Config) NewReadWriter(rw io.ReadWriter) *ReadWriter
NewReadWriter runs both a Reader and a BusWriter on an io.ReaderWriter using the ReaderConfig for the reader.
type ReadWriter ¶
ReadWriter runs both a Reader and a BusWriter on an io.ReaderWriter.
func NewReadWriter ¶
func NewReadWriter(rw io.ReadWriter) *ReadWriter
NewReadWriter runs both a Reader and a BusWriter on an io.ReaderWriter.
Click to show internal directories.
Click to hide internal directories.