Documentation
¶
Overview ¶
Package io provides context-aware I/O operations.
Index ¶
- Variables
- func CopyContext(ctx context.Context, dst DeadlineWriter, src DeadlineReader) (written int64, err error)
- func Pipe() (*PipeReader, *PipeWriter)
- func SetNonblock(f *os.File) error
- type DeadlineReadCloser
- type DeadlineReader
- type DeadlineWriteCloser
- type DeadlineWriter
- type PipeReader
- type PipeWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosedPipe = stdio.ErrClosedPipe
Functions ¶
func CopyContext ¶
func CopyContext(ctx context.Context, dst DeadlineWriter, src DeadlineReader) (written int64, err error)
CopyContext is equivalent to `io.Copy` but with context cancellation support (for deadline reader/writers).
func Pipe ¶
func Pipe() (*PipeReader, *PipeWriter)
Pipe is equivalent to `io.Pipe` but with deadline support.
func SetNonblock ¶ added in v0.4.2
Types ¶
type DeadlineReadCloser ¶
type DeadlineReadCloser interface {
DeadlineReader
stdio.Closer
}
type DeadlineReader ¶
Reader types.
func NopDeadlineReader ¶
func NopDeadlineReader(r stdio.Reader) DeadlineReader
type DeadlineWriteCloser ¶
type DeadlineWriteCloser interface {
DeadlineWriter
stdio.Closer
}
type DeadlineWriter ¶
Writer types.
func NopDeadlineWriter ¶
func NopDeadlineWriter(w stdio.Writer) DeadlineWriter
type PipeReader ¶
type PipeReader struct {
// contains filtered or unexported fields
}
A PipeReader is the read half of a pipe.
func (*PipeReader) Close ¶
func (r *PipeReader) Close() error
func (*PipeReader) SetReadDeadline ¶
func (r *PipeReader) SetReadDeadline(t time.Time) error
type PipeWriter ¶
type PipeWriter struct {
// contains filtered or unexported fields
}
A PipeWriter is the write half of a pipe.
func (*PipeWriter) Close ¶
func (w *PipeWriter) Close() error
func (*PipeWriter) SetWriteDeadline ¶
func (w *PipeWriter) SetWriteDeadline(t time.Time) error
Click to show internal directories.
Click to hide internal directories.