Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressReadSeeker ¶ added in v0.45.0
type ProgressReadSeeker struct {
// contains filtered or unexported fields
}
ProgressReadSeeker wraps an io.ReadSeeker and tracks read progress
func NewProgressReader ¶ added in v0.45.0
func NewProgressReader(rs io.ReadSeeker, total int64, onProgress func(read int64, total int64)) *ProgressReadSeeker
NewProgressReader creates a new ProgressReader
func (*ProgressReadSeeker) BytesRead ¶ added in v0.45.0
func (pr *ProgressReadSeeker) BytesRead() int64
Read returns the number of bytes read so far
func (*ProgressReadSeeker) Progress ¶ added in v0.45.0
func (pr *ProgressReadSeeker) Progress() float64
Progress returns the current progress as a float64 between 0 and 1
func (*ProgressReadSeeker) Read ¶ added in v0.45.0
func (pr *ProgressReadSeeker) Read(p []byte) (int, error)
Read implements io.Reader
func (*ProgressReadSeeker) Seek ¶ added in v0.45.0
func (pr *ProgressReadSeeker) Seek(offset int64, whence int) (int64, error)
Seek implements io.ReadSeeker.
func (*ProgressReadSeeker) Total ¶ added in v0.45.0
func (pr *ProgressReadSeeker) Total() int64
Total returns the total number of bytes
type ProgressWriter ¶
type ProgressWriter struct {
// contains filtered or unexported fields
}
func NewProgressWriter ¶
func NewProgressWriter( wr io.Writer, onWrite func(n int), ) *ProgressWriter
type ProgressWriterAt ¶
type ProgressWriterAt struct {
// contains filtered or unexported fields
}
func NewProgressWriterAt ¶
func NewProgressWriterAt( wrAt io.WriterAt, onWrite func(n int), ) *ProgressWriterAt
Click to show internal directories.
Click to hide internal directories.