download

package
v2.0.11 Latest Latest
Warning

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

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

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

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

func (Bar) SetOutput

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

type FileInfo struct {
	Name string
	Mode os.FileMode
}

func NewFileInfo

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

type Range

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

func NewRange

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