Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func After ¶
After returns an io.Reader that proxies to another Reader and calls f after each Read that returns an io.EOF error. If io.EOF is never returned, f is never called and if io.EOF is returned multiple times, f will be called multiple times. If f returns an error, it is returned from the call to Read instead of io.EOF.
func Before ¶
Before returns an io.Reader that proxies calls to Read and executes the given function exactly once before the first call. If the function errors, the error is returned and the call to Read is never proxied to the inner io.Reader (subsequent calls to Read will still be proxied). Because no call to Read returns until the one call to f returns, if f causes Read to be called, it will deadlock. If f panics, Read considers it to have returned; future calls of Read return without calling f. For more information see the documentation for sync.Once.
Types ¶
This section is empty.