Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyAndClose ¶
func ParseVersionJSON ¶
Parses any JSON map of (string) keys to whatever, and returns the value of the "version" key as an integer. Otherwise, returns (-1, false).
Types ¶
type AutoCloseReader ¶
type AutoCloseReader struct {
RC io.ReadCloser
}
Wrapper around io.ReadCloser making an io.Reader that automatically closes.
type IntervalTimer ¶
type IntervalTimer interface {
Stop()
}
func NewTimer ¶
func NewTimer(millis int, f func()) IntervalTimer
Start a timer that will call back to a function every N milliseconds.
type ProgressFunc ¶
type ProgressFunc func(progress, total int)
type ProgressReader ¶
type ProgressReader struct { Reader io.Reader // underlying reader Size int // total size of data // contains filtered or unexported fields }
An io.Reader that outputs its progress every N milliseconds.
func NewProgressReader ¶
func NewProgressReader(r io.Reader, size int, millis int, f ProgressFunc) *ProgressReader
Click to show internal directories.
Click to hide internal directories.