download

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: Apache-2.0 Imports: 15 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar struct {
	*pb.ProgressBar
}

func NewBar

func NewBar() Bar

func (Bar) Kickoff

func (b Bar) Kickoff()

func (Bar) NewProxyReader added in v0.0.39

func (b Bar) NewProxyReader(reader io.Reader) io.Reader

func (Bar) SetOutput added in v0.0.37

func (b Bar) SetOutput(output io.Writer)

func (Bar) SetTotal

func (b Bar) SetTotal(contentLength int64)

type Client

type Client struct {
	HTTPClient httpClient
	Ranger     ranger
	Bar        bar
	Logger     logger.Logger
	Timeout    time.Duration
}

func (Client) Get

func (c Client) Get(
	location *FileInfo,
	downloadLinkFetcher downloadLinkFetcher,
	progressWriter io.Writer,
) error

type FileInfo added in v0.0.52

type FileInfo struct {
	Name string
	Mode os.FileMode
}

func NewFileInfo added in v0.0.52

func NewFileInfo(file *os.File) (*FileInfo, error)

type Range

type Range struct {
	Lower      int64
	Upper      int64
	HTTPHeader http.Header
}

func NewRange added in v0.0.49

func NewRange(lower int64, upper int64, httpHeader http.Header) Range

type Ranger

type Ranger struct {
	// contains filtered or unexported fields
}

func NewRanger

func NewRanger(hunks int) Ranger

func (Ranger) BuildRange

func (r Ranger) BuildRange(contentLength int64) ([]Range, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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