iolimit

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package iolimit provides small internal reader wrappers for length-constrained stream I/O.

Index

Constants

This section is empty.

Variables

View Source
var ErrExpectedLengthExceeded = errors.New("iolimit: stream exceeded expected length")

ErrExpectedLengthExceeded reports that a stream produced bytes beyond the expected length.

Functions

func ExpectLengthReader

func ExpectLengthReader(src io.Reader, expected int64) io.Reader

ExpectLengthReader wraps src and enforces an expected byte length.

It returns io.ErrUnexpectedEOF if src ends before expected bytes are read. It returns ErrExpectedLengthExceeded if reads continue beyond the expected boundary and src still produces bytes.

This reader does not drain src on close or at the expected boundary. As a result, overlength streams are detected only when a caller reads at or past the boundary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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