Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupted = fmt.Errorf("read interrupted by channel")
Functions ¶
This section is empty.
Types ¶
type ChanReader ¶
type ChanReader struct {
// contains filtered or unexported fields
}
Implements the io.Reader interface for a chan []byte
func NewChanReader ¶
func NewChanReader(input <-chan *StreamChunk) *ChanReader
func (*ChanReader) Read ¶
func (c *ChanReader) Read(out []byte) (int, error)
Read from the channel into `out`. This will block until data is available, and can be interrupted with a channel using `SetInterrupt()`. If the read was interrupted, `ErrInterrupted` will be returned.
func (*ChanReader) SetInterrupt ¶
func (c *ChanReader) SetInterrupt(interrupt <-chan struct{})
Specify a channel that can interrupt a read if it is blocking.
type ChanWriter ¶
type ChanWriter struct {
// contains filtered or unexported fields
}
Implements the io.WriteCloser interface for a chan []byte
func NewChanWriter ¶
func NewChanWriter(output chan<- *StreamChunk) *ChanWriter
type StreamChunk ¶
Stores a slice of bytes with its receive timestmap
Click to show internal directories.
Click to hide internal directories.