ioext

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ioext provides io utilities.

Index

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

func ChainCloser(closers ...io.Closer) io.Closer

ChainCloser chains the closers by calling them in order.

func CompositeReadCloser

func CompositeReadCloser(reader io.Reader, closer io.Closer) io.ReadCloser

CompositeReadCloser returns a io.ReadCloser that is a composite of the Reader and Closer.

func CompositeWriteCloser

func CompositeWriteCloser(writer io.Writer, closer io.Closer) io.WriteCloser

CompositeWriteCloser returns a io.WriteCloser that is a composite of the Writer and Closer.

func LockedWriter

func LockedWriter(writer io.Writer) io.Writer

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.

func ReaderAtForReader

func ReaderAtForReader(reader io.Reader) (io.ReaderAt, error)

ReaderAtForReader converts an io.Reader to an io.ReaderAt.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL