buf: github.com/bufbuild/buf/internal/pkg/ioutilextended Index | Files

package ioutilextended

import "github.com/bufbuild/buf/internal/pkg/ioutilextended"

Package ioutilextended provides io utilities.


Package Files



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)

func ChainCloser Uses

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

ChainCloser chains the closers by calling them in order.

func CompositeReadCloser Uses

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 Uses

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 Uses

func LockedWriter(writer io.Writer) io.Writer

LockedWriter creates a locked Writer.

func NopWriteCloser Uses

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 Uses

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

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

Package ioutilextended imports 5 packages (graph) and is imported by 4 packages. Updated 2020-10-20. Refresh now. Tools for package owners.