Documentation
¶
Overview ¶
Package contextio provides io.Writer and io.Reader that stop accepting/providing data when an attached context is canceled.
AJ: I want to minimize 3rd party dependencies on my own go-aj packages This was taken from https://github.com/dolmen-go/contextio as is.
Package contextio provides io.Writer and io.Reader that stop accepting/providing data when an attached context is canceled.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCloser ¶
NewCloser wraps an io.Reader to handle context cancellation.
Context state is checked BEFORE any Close.
func NewReader ¶
NewReader wraps an io.Reader to handle context cancellation.
Context state is checked BEFORE every Read.
func NewWriter ¶
NewWriter wraps an io.Writer to handle context cancellation.
Context state is checked BEFORE every Write.
The returned Writer also implements io.ReaderFrom to allow io.Copy to select the best strategy while still checking the context state before every chunk transfer.
Types ¶
This section is empty.