Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
FormatSize returns a human-readable string representation of a size in bytes.
Types ¶
type LimitReader ¶
type LimitReader struct {
// contains filtered or unexported fields
}
LimitReader wraps an io.ReadSeeker and limits the number of bytes that can be read.
func NewLimitReader ¶
func NewLimitReader(reader io.ReadSeeker, limit int64) *LimitReader
NewLimitReader creates a new LimitReader.
type Membuf ¶
type Membuf struct {
// contains filtered or unexported fields
}
Membuf is an in-memory buffer that implements the ReadWriteSeeker interface.
func NewMembufN ¶
NewMembufN creates a new Membuf with N bytes allocated.
type OffsetReader ¶
type OffsetReader struct {
// contains filtered or unexported fields
}
OffsetReader wraps an io.ReadSeeker and adds an offset to the seek position.
func NewOffsetReader ¶
func NewOffsetReader(reader io.ReadSeeker, offset int64) *OffsetReader
NewOffsetReader creates a new OffsetReader.
type ProgressReader ¶
type ProgressReader struct {
// contains filtered or unexported fields
}
ProgressReader wraps an io.Reader and reports the number of bytes read.
func NewProgressReader ¶
func NewProgressReader(reader io.Reader, max int64) *ProgressReader
NewProgressReader creates a new ProgressReader.
type RandomReader ¶
type RandomReader struct { // Size is the size of the file. Size int64 }
RandomReader is a io.Reader that returns random bytes. This uses math/rand to generate random bytes and should not be used for security purposes.
type ZeroReadSeeker ¶
type ZeroReadSeeker struct { // Size is the size of the file. Size int64 // contains filtered or unexported fields }
ZeroReadSeeker is a ReadSeeker that always returns null bytes.