Documentation ¶
Overview ¶
Package ioextended provides io utilities.
Index ¶
- Variables
- func ChainCloser(closers ...io.Closer) io.Closer
- func CompositeReadCloser(reader io.Reader, closer io.Closer) io.ReadCloser
- func CompositeWriteCloser(writer io.Writer, closer io.Closer) io.WriteCloser
- func LockedWriter(writer io.Writer) io.Writer
- func NopWriteCloser(writer io.Writer) io.WriteCloser
- func ReaderAtForReader(reader io.Reader) (io.ReaderAt, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DiscardReader is an io.Reader in which all calls return 0 and io.EOF. DiscardReader io.Reader = discardReader{} // DiscardReadCloser is an io.ReadCloser in which all calls return 0 and io.EOF. DiscardReadCloser io.ReadCloser = io.NopCloser(DiscardReader) // DiscardWriteCloser is a discard io.WriteCloser. DiscardWriteCloser io.WriteCloser = NopWriteCloser(io.Discard) // NopCloser is a no-op closer. NopCloser = nopCloser{} )
Functions ¶
func ChainCloser ¶
ChainCloser chains the closers by calling them in order.
func CompositeReadCloser ¶
CompositeReadCloser returns a io.ReadCloser that is a composite of the Reader and Closer.
func CompositeWriteCloser ¶
CompositeWriteCloser returns a io.WriteCloser that is a composite of the Writer and Closer.
func LockedWriter ¶
LockedWriter creates a locked Writer.
func NopWriteCloser ¶
func NopWriteCloser(writer io.Writer) io.WriteCloser
NopWriteCloser returns an io.WriteCloser with a no-op Close method wrapping the provided io.Writer.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.