Help us shape the future of Go! Take the 2026 Go Developer Survey

contextio

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package contextio keeps file/archive work responsive to a build's lifetime. It does not add goroutines: network readers must also bind their request to the context, while ordinary file and decompression reads stop between chunks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(ctx context.Context, destination io.Writer, input io.Reader) (int64, error)

func CopyN

func CopyN(ctx context.Context, destination io.Writer, input io.Reader, size int64) (int64, error)

func Filesystem

func Filesystem(ctx context.Context, tree fs.FS) fs.FS

Filesystem wraps embedded/ZIP resource reads without changing path ownership.

func ReadAll

func ReadAll(ctx context.Context, input io.Reader) ([]byte, error)

func ReadFile

func ReadFile(ctx context.Context, name string) ([]byte, error)

func Reader

func Reader(ctx context.Context, input io.Reader) io.Reader

Reader checks cancellation around every bounded read, including reads that also produce bytes or EOF. Wrapping removes optional unbounded fast paths.

func Sum256

func Sum256(ctx context.Context, contents []byte) ([sha256.Size]byte, error)

func WriteFile

func WriteFile(ctx context.Context, name string, contents []byte, mode fs.FileMode) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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