Documentation ¶
Index ¶
Constants ¶
View Source
const MaxPackageFileSize = 32 * 1024 * 1024
MaxPackageFileSize is a maximum package file length in bytes. The largest package whose size is limited by this constant currently has the size of approximately 9 MiB.
Variables ¶
This section is empty.
Functions ¶
func LimitReader ¶
LimitReader wraps Reader to make it's Reader stop with ErrLimitReached after n bytes read.
func Min ¶
func Min[T constraints.Integer | ~string](x, y T) (res T)
Min returns the smaller of x or y.
Types ¶
type LimitReachedError ¶
type LimitReachedError struct {
Limit int64
}
LimitReachedError records the limit and the operation that caused it.
func (*LimitReachedError) Error ¶
func (lre *LimitReachedError) Error() string
Error implements the [error] interface for *LimitReachedError.
TODO(a.garipov): Think about error string format.
Click to show internal directories.
Click to hide internal directories.