Documentation ¶
Index ¶
Constants ¶
View Source
const (
ISSUE_MSG = " Please open up a Github issue to report this error! https://github.com/karl-cardenas-coding/disaster-cli"
)
Variables ¶
Functions ¶
func DownloadFile ¶ added in v1.3.1
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory. We pass an io.TeeReader into Copy() to report progress on the download.
Types ¶
type WriteCounter ¶ added in v1.3.1
type WriteCounter struct {
Total uint64
}
https://golangcode.com/download-a-file-with-progress/ WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.
func (WriteCounter) PrintProgress ¶ added in v1.3.1
func (wc WriteCounter) PrintProgress()
Click to show internal directories.
Click to hide internal directories.