ioutilextended

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ioutilextended 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 = ioutil.NopCloser(DiscardReader)
	// DiscardWriteCloser is a discard io.WriteCloser
	DiscardWriteCloser io.WriteCloser = NopWriteCloser(ioutil.Discard)
)

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 added in v0.20.0

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 ReadPassword added in v0.21.0

func ReadPassword(reader io.Reader) ([]byte, error)

ReadPassword provides a way to prompt a user for a password. It reads a line from the input without echoing it and strips the terminating \n.

If the reader used is not a terminal, this will simply read until the next newline.

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