ioutil

package
v2.0.0-...-9cac419 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBuffer

func CopyBuffer(dst io.Writer, src io.Reader, buf []byte, desc ocispec.Descriptor) error

CopyBuffer copies from src to dst through the provided buffer until either EOF is reached on src, or an error occurs. The copied content is verified against the size and the digest.

func UnwrapNopCloser

func UnwrapNopCloser(rc io.Reader) io.Reader

UnwrapNopCloser unwraps the reader wrapped by `io.NopCloser()`. Similar implementation can be found in the built-in package `net/http`. Reference: https://github.com/golang/go/blob/go1.17.6/src/net/http/transfer.go#L423-L425

Types

type CloserFunc

type CloserFunc func() error

CloserFunc is the basic Close method defined in io.Closer.

func (CloserFunc) Close

func (fn CloserFunc) Close() error

Close performs close operation by the CloserFunc.

Jump to

Keyboard shortcuts

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