Documentation ¶
Overview ¶
iofilter can help filter data arriving from an io.ReadCloser It allows wraping an existing io.ReadCloser provider and filter the data before exposing it it up the chain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iofilter ¶
type Iofilter struct {
// contains filtered or unexported fields
}
An Iofilter object maintining internal buffers and state
func New ¶
func New(src io.ReadCloser, filter func(buf []byte, state interface{}), state interface{}, params ...uint) (iof *Iofilter)
Create a New iofilter to wrap an existing provider of an io.ReadCloser interface The new iofilter will expose an io.ReadCloser interface The data will be sent to filter before it is delivered The optional params may include a two integer parameter indicating: 1. The number of buffers which may be at least 3 (default is 3) 2. The size of the buffers (default is 8192) A goroutine will be initiatd to wait on the original provider Read interface and deliver the data to the Readwer using an internal channel
func (*Iofilter) WaitTillDone ¶ added in v1.2.0
func (iof *Iofilter) WaitTillDone()