httpclient

package
v0.0.0-...-d509172 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const FlushDiskSize = 1024 * 1024

Variables

This section is empty.

Functions

func CheckMultipart

func CheckMultipart(urls string) (bool, error)

func GetSize

func GetSize(urls string) (int64, error)

Types

type DefaultDownloader

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

func CreateDefaultDownloader

func CreateDefaultDownloader(url string, file *iotools.SafeFile) *DefaultDownloader

func (*DefaultDownloader) AfterStop

func (pd *DefaultDownloader) AfterStop() error

func (*DefaultDownloader) BeforeRun

func (pd *DefaultDownloader) BeforeRun() error

func (*DefaultDownloader) DoWork

func (pd *DefaultDownloader) DoWork() (bool, error)

func (DefaultDownloader) GetProgress

func (pd DefaultDownloader) GetProgress() interface{}

type DownloadProgress

type DownloadProgress struct {
	From          int64 `json:"From"`
	To            int64 `json:"To"`
	Pos           int64 `json:"Pos"`
	BytesInSecond int64
	Speed         int64
	Lsmt          time.Time
}

type Downloader

type Downloader struct {
	Fi FileInfo
	// contains filtered or unexported fields
}

func CreateDownloader

func CreateDownloader(url string, fp string, seg int64, getDown func() string, pipes ...func(*Downloader) error) (dl *Downloader, err error)

func RestoreDownloader

func RestoreDownloader(url string, fp string, dp []DownloadProgress, getDown func() string, pipes ...func(*Downloader) error) (dl *Downloader, err error)

func (*Downloader) GetProgress

func (dl *Downloader) GetProgress() []DownloadProgress

func (*Downloader) ProgressGetter

func (dl *Downloader) ProgressGetter() func() (downloaded int64, total int64, percentProgress int64, speed int64)

func (*Downloader) SafeFile

func (dl *Downloader) SafeFile() *iotools.SafeFile

func (*Downloader) SetProgressGetter

func (dl *Downloader) SetProgressGetter(f func() (downloaded int64, total int64, percentProgress int64, speed int64)) *Downloader

func (*Downloader) StartAll

func (dl *Downloader) StartAll() []error

func (*Downloader) State

func (dl *Downloader) State() monitor.State

func (*Downloader) StopAll

func (dl *Downloader) StopAll() []error

type FileInfo

type FileInfo struct {
	Size     int64    `json:"Size"`
	FileName string   `json:"FileName"`
	Url      string   `json:"Url"`
	Pipes    []string `json:"Pipes"`
}

type PartialDownloader

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

func CreatePartialDownloader

func CreatePartialDownloader(url string, file *iotools.SafeFile, from int64, pos int64, to int64) *PartialDownloader

func (*PartialDownloader) AfterStop

func (pd *PartialDownloader) AfterStop() error

func (*PartialDownloader) AfterStopDownload

func (pd *PartialDownloader) AfterStopDownload() error

func (*PartialDownloader) BeforeDownload

func (pd *PartialDownloader) BeforeDownload() error

func (*PartialDownloader) BeforeRun

func (pd *PartialDownloader) BeforeRun() error

func (*PartialDownloader) DoWork

func (pd *PartialDownloader) DoWork() (bool, error)

func (*PartialDownloader) DownloadSergment

func (pd *PartialDownloader) DownloadSergment() (bool, error)

func (PartialDownloader) GetProgress

func (pd PartialDownloader) GetProgress() interface{}

Jump to

Keyboard shortcuts

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