Documentation ¶
Index ¶
- func Download(url string, downloadTofileName string)
- func DownloadExtract(url string, assetName string) error
- func DownloadFile(filepath string, url string) error
- func Exists(name string) bool
- func Extract(assetName string, downloadLocation string, extractPath string)
- func GetCurrentPath() (string, error)
- func Untar(gzStream string, dst string) error
- func Unzip(src, dest string) error
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Download performs file download of the given url this method provides no feedback to the system
func DownloadExtract ¶
DownloadExtract sets up and runs the functions needed for downloading and extracting of assets
func DownloadFile ¶
DownloadFile will download a url to a local file. efficiently writes as it downloads instead of loading file in memory io.TeeReader is passed into Copy() to report progress on the download
func GetCurrentPath ¶
GetCurrentPath gets the path of the go app
Types ¶
type WriteCounter ¶
type WriteCounter struct {
Total uint64
}
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 ¶
func (wc WriteCounter) PrintProgress()
PrintProgress will print current status of download