downloader

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchContentFromURL added in v0.9.0

func FetchContentFromURL(url string) ([]byte, error)

func SetUpProgressBar added in v0.10.0

func SetUpProgressBar(resp *http.Response, downFile io.Writer) (int64, error)

setUpProgressBar create bar and setup

Types

type Downloader added in v0.10.0

type Downloader struct {
	EnableProgressBar bool
	// contains filtered or unexported fields
}

func New added in v0.10.0

func New() *Downloader

func (*Downloader) Download added in v0.10.0

func (d *Downloader) Download(url, filename, targetDir string) (size int64, err error)

Download a file from the URL to the target path if filename is "", use the remote filename at local.

func (*Downloader) WithClient added in v0.10.0

func (d *Downloader) WithClient(client *http.Client) *Downloader

func (*Downloader) WithProgressBar added in v0.10.0

func (d *Downloader) WithProgressBar() *Downloader

type ResourceLocation added in v0.10.0

type ResourceLocation string

ResourceLocation represent location of resource, url/localPath/gitPath for example

func (ResourceLocation) Download added in v0.10.0

func (l ResourceLocation) Download() (string, error)

config detectors|decompressors|getters for resource getter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL