Documentation
¶
Index ¶
Constants ¶
View Source
const ( OneKB uint64 = 1024 OneMB = 1024 * OneKB OneGB = 1024 * OneMB )
Variables ¶
View Source
var ErrReadLimitExceeded = errors.New("read limit exceeded")
Functions ¶
func ReadLimited ¶
ReadLimited reads data from the provided reader up to the given limit. It returns ErrReadLimitExceeded if the data exceeds the specified limit. Under the hood, it reads a single extra byte to check if the limit is exceeded. If that is a concern for your use case, just use io.LimitReader directly.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.