streamcopy

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package streamcopy copies known-length blob streams in larger pooled chunks.

Index

Constants

View Source
const BufferSize = 1 << 20

BufferSize balances stream-call reduction against concurrent memory use. At the benchmark's 10 peer serves plus 6 local downloads, a fully busy agent can hold at most roughly 16 MiB of copy buffers.

Variables

This section is empty.

Functions

func CopyN

func CopyN(dst io.Writer, src io.Reader, size int64) (int64, error)

CopyN copies exactly size bytes. It fills each pooled chunk before writing, reducing containerd ReaderAt streams and downstream Writer calls while preserving partial bytes and the original read error on interruption.

Types

This section is empty.

Jump to

Keyboard shortcuts

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