Documentation
¶
Overview ¶
Package verifiedio provides bounded content copying for worker staging.
Index ¶
- func Copy(ctx context.Context, source io.Reader, destination io.Writer, size int64, ...) error
- func CopyLimit(ctx context.Context, source io.Reader, destination io.Writer, ...) error
- func Read(ctx context.Context, source io.ReadCloser, destination io.Writer, ...) error
- func Snapshot(ctx context.Context, data []byte, release func()) io.ReadCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy(ctx context.Context, source io.Reader, destination io.Writer, size int64, digest string) error
Copy requires the exact byte count and digest before reporting success.
func CopyLimit ¶
func CopyLimit(ctx context.Context, source io.Reader, destination io.Writer, size, maximum int64, digest string) error
CopyLimit bounds bytes even when the source size is unknown.
func Read ¶
func Read(ctx context.Context, source io.ReadCloser, destination io.Writer, size, maximum int64, digest string) error
Read copies from a source that must unblock Read when Close is called. It closes the source exactly once, including on cancellation, and retains close errors. A negative size permits up to maximum bytes; otherwise the exact size is required. The digest is a lowercase SHA256 without a prefix.
func Snapshot ¶
func Snapshot(ctx context.Context, data []byte, release func()) io.ReadCloser
Snapshot takes ownership of verified bytes and returns a cancellation-aware memory reader. Close releases its bytes and calls release exactly once. Reads and Close may run concurrently. The caller must not mutate data after transfer.
Types ¶
This section is empty.