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
Click to show internal directories.
Click to hide internal directories.