readlimit

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package readlimit provides helpers to enforce read size limits across repository collectors.

Index

Constants

View Source
const DefaultMaxReadSize int64 = 7 << 20

DefaultMaxReadSize is the fallback maximum read size (7 MiB) used when the caller does not specify a limit (i.e. MaxReadSize == 0).

Variables

This section is empty.

Functions

func Reader

func Reader(r io.Reader, maxReadSize int64) io.Reader

Reader wraps r with an io.LimitReader using the resolved max read size.

func Resolve

func Resolve(maxReadSize int64) int64

Resolve returns maxReadSize if it is positive, otherwise DefaultMaxReadSize.

Types

This section is empty.

Jump to

Keyboard shortcuts

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