download

package
v0.0.0-...-cf10193 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(url, outputPath, socks5Url string, readBody ReadBodyFunc, processFb, successFb, errorFb FBFunc) error

func DownloadAsync

func DownloadAsync(url, outputPath, socks5Url string, chunkSize int64) error

func DownloadAsyncResume

func DownloadAsyncResume(httpClient *http.Client, status chan utils.Info, infos map[string]utils.Info, wg *sync.WaitGroup) error

func DownloadAsyncResumeWork

func DownloadAsyncResumeWork(httpClient *http.Client, status chan utils.Info, info utils.Info, wg *sync.WaitGroup) error

func DownloadRange

func DownloadRange(url, outputPath, socks5Url, Range string, readBody func(resp *http.Response, out string) error) error

func DownloadStatus

func DownloadStatus(status chan utils.Info, outputPath string)

func GenHttpClient

func GenHttpClient(socks5Url string) (*http.Client, error)

func LoadInfos

func LoadInfos(statusFilename string) (map[string]utils.Info, error)

func NewInfos

func NewInfos(url, outputPath string, size, chunkSize int64, status chan utils.Info) (map[string]utils.Info, error)

func ReadBody

func ReadBody(resp *http.Response, out *os.File, processFb, successFb, errorFb FBFunc) error

Types

type ErrorFunc

type ErrorFunc func(outputPath string, length, downLen int64, err error)

type FBFunc

type FBFunc func(data utils.Info)

type ReadBodyFunc

type ReadBodyFunc func(resp *http.Response, out *os.File, processFb, successFb, errorFb FBFunc) error

type SuccessFunc

type SuccessFunc func(outputPath string, length, downLen int64)

Jump to

Keyboard shortcuts

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