io

package
v1.8.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitCopy

func LimitCopy(dst io.Writer, r io.ReadCloser, limit int64) (int64, error)

LimitCopy copies from the provided io.ReadCloser to dst up to the specified limit. If the source exceeds the limit, it returns an error. It returns the number of bytes copied or an error if any issues occur during copying.

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. 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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