downloader

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackDownloader

type BackDownloader struct {
	// URL is the source url of the file to download.
	URL string

	// Target is the full target path.
	Target string

	// Md5 is the expected file md5 to prevent files from being tampered with.
	Md5 string

	// TaskID a string which represents a unique task.
	TaskID string
	// contains filtered or unexported fields
}

BackDownloader downloads the file from file resource.

func NewBackDownloader

func NewBackDownloader(cfg *config.Config, result *regist.RegisterResult) *BackDownloader

NewBackDownloader creates a BackDownloader.

func (*BackDownloader) Cleanup

func (bd *BackDownloader) Cleanup()

Cleanup clean all temporary resources generated by executing Run.

func (*BackDownloader) Run

func (bd *BackDownloader) Run(ctx context.Context) error

Run starts to download the file.

func (*BackDownloader) RunStream added in v1.0.1

func (bd *BackDownloader) RunStream(ctx context.Context) (io.Reader, error)

RunStream returns a io.Reader without any disk io.

Jump to

Keyboard shortcuts

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