readcloser

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FatalReadCloser

func FatalReadCloser(err error) io.ReadCloser

FatalReadCloser returns a ReadCloser that always fails with err.

func LazyReadCloser

func LazyReadCloser(reader func() (io.ReadCloser, error)) io.ReadCloser

LazyReadCloser returns an ReadCloser that doesn't initialize the backing Reader until the first Read.

func LimitReadCloser

func LimitReadCloser(r io.ReadCloser, n int64) io.ReadCloser

LimitReadCloser is a LimitReader extension that returns a ReadCloser that reads from r but stops with EOF after n bytes.

func MultiReadCloser

func MultiReadCloser(readers ...io.ReadCloser) io.ReadCloser

MultiReadCloser is a MultiReader extension that returns a ReaderCloser that's the logical concatenation of the provided input readers. They're read sequentially. Once all inputs have returned EOF, Read will return EOF. If any of the readers return a non-nil, non-EOF error, Read will return that error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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