io

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitRead

func LimitRead(r io.ReadCloser, limit int64) ([]byte, error)

LimitRead reads from the provided io.ReadCloser up to the specified limit. If the body exceeds the limit, it returns an error. If the body is exactly the limit, it checks for additional content and returns an error if any additional content is found. It returns the read bytes or an error if any issues occur during reading.

Types

type BodyTooLargeError

type BodyTooLargeError struct {
	// contains filtered or unexported fields
}

BodyTooLargeError is an error that indicates that the size of a request or response body exceeded a specified limit.

func (*BodyTooLargeError) Error

func (e *BodyTooLargeError) Error() string

func (*BodyTooLargeError) Is

func (e *BodyTooLargeError) Is(target error) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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