Documentation ¶
Overview ¶
Package ioutil provides wrappers around golang IO interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MeteredReadCloser ¶
type MeteredReadCloser interface { io.ReadCloser // Bytes reports the total number of bytes read in Read calls. Bytes() int64 // Duration reports the total duration of time spent on Read calls. Duration() time.Duration }
MeteredReadCloser tracks how much time is spent and bytes are read in Read calls.
func NewMeteredReadCloser ¶
func NewMeteredReadCloser(rc io.ReadCloser, fns ...func(int, time.Duration)) MeteredReadCloser
NewMeteredReadCloser creates a MeteredReadCloser which tracks the amount of time spent and bytes read in Read calls to the provided inner ReadCloser. Optional callbacks will be called with the time spent and bytes read in each Read call.
type MeteredReader ¶
type MeteredReader interface { io.Reader // Bytes reports the total number of bytes read in Read calls. Bytes() int64 // Duration reports the total duration of time spent on Read calls. Duration() time.Duration }
MeteredReader tracks how much time is spent and bytes are read in Read calls.
func NewMeteredReader ¶
NewMeteredReader creates a MeteredReader which tracks the amount of time spent and bytes read in Read calls to the provided inner Reader. Optional callbacks will be called with the time spent and bytes read in each Read call.
type MeteredWriteCloser ¶
type MeteredWriteCloser interface { io.WriteCloser // Duration reports the total duration of time spent on Write calls. Duration() time.Duration }
MeteredWriteCloser tracks how much time is spent and bytes are written in Write calls.
func NewMeteredWriteCloser ¶
func NewMeteredWriteCloser(wc io.WriteCloser, fns ...func(int, time.Duration)) MeteredWriteCloser
NewMeteredWriteCloser creates a MeteredWriteCloser which tracks the amount of time spent and bytes writtein in Write calls to the provided inner WriteCloser. Optional callbacks will be called with the time spent and bytes written in each Write call.
type MeteredWriter ¶
type MeteredWriter interface { io.Writer // Duration reports the total duration of time spent on Writer calls. Duration() time.Duration }
MeteredWriter tracks how much time is spent and bytes are written in Write calls.
func NewMeteredWriter ¶
NewMeteredWriter creates a MeteredWriter which tracks the amount of time spent and bytes written in Write calls to the provided inner Writer. Optional callbacks will be called with the time spent and bytes written in each Write call.
type TimeoutCloser ¶
type TimeoutCloser struct {
// contains filtered or unexported fields
}
TimeoutCloser is an io.Closer that has a timeout for executing the Close() function.
func NewTimeoutCloser ¶
func (*TimeoutCloser) Close ¶
func (c *TimeoutCloser) Close() error