ioutils

package
v27.3.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCtx

func CopyCtx(ctx context.Context, dst io.Writer, src io.Reader) (n int64, err error)

CopyCtx copies from src to dst until either EOF is reached on src or a context is cancelled. The writer is not closed when the context is cancelled.

After CopyCtx exits due to context cancellation, the goroutine that performed the copy may still be running if either the reader or writer blocks.

func NewCtxReader

func NewCtxReader(ctx context.Context, r io.Reader) io.Reader

NewCtxReader wraps the given reader with a reader that doesn't proceed with reading if the context is done.

Note: Read will still block if the underlying reader blocks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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