readlimit

package
v0.264.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package readlimit provides bounded reads for user-controlled files, stdin, and HTTP bodies.

Index

Constants

View Source
const (
	Config      int64 = 4 << 20
	Secret      int64 = 1 << 20
	Document    int64 = 64 << 20
	APIResponse int64 = 64 << 20
)

Variables

This section is empty.

Functions

func All

func All(r io.Reader, max int64, label string) ([]byte, error)

All reads at most max bytes and returns an actionable error if more data is available. label identifies the input in the error message.

func File

func File(path string, max int64, label string) ([]byte, error)

File opens path and reads it through All.

func SecretPermissionWarning

func SecretPermissionWarning(path, label string) string

SecretPermissionWarning reports a regular secret file that is readable or writable by group/other users. It is advisory because mounted container secrets do not always permit chmod.

Types

This section is empty.

Jump to

Keyboard shortcuts

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