Documentation
¶
Index ¶
- func DownloadFile(clientHTTP *http.Client, urlFile string, fileOut string) error
- func DownloadFileWithProgress(clientHTTP *http.Client, urlFile string, fileOut string, ...) error
- func DownloadFileWithResume(clientHTTP *http.Client, urlFile string, fileOut string, ...) error
- func DownloadFileWithResumeOptions(clientHTTP *http.Client, urlFile string, fileOut string, ...) error
- func IsUnexpectedStatus(err error, code int) bool
- func NewClient(shouldAllowInsecureTLS bool) *http.Client
- func RetryAfter(err error) time.Duration
- type DownloadOptions
- type DownloadProgressFunc
- type RangeIgnoredError
- type RequestLimiter
- type UnexpectedStatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
func DownloadFileWithResume ¶
func DownloadFileWithResumeOptions ¶
func DownloadFileWithResumeOptions(clientHTTP *http.Client, urlFile string, fileOut string, progress DownloadProgressFunc, options DownloadOptions) error
func IsUnexpectedStatus ¶
func RetryAfter ¶
Types ¶
type DownloadOptions ¶
type DownloadOptions struct {
Limiter *RequestLimiter
}
type DownloadProgressFunc ¶
type RangeIgnoredError ¶
type RangeIgnoredError struct {
URL string
}
func (RangeIgnoredError) Error ¶
func (err RangeIgnoredError) Error() string
type RequestLimiter ¶
type RequestLimiter struct {
// contains filtered or unexported fields
}
func NewRequestLimiter ¶
func NewRequestLimiter(requestInterval time.Duration) *RequestLimiter
func (*RequestLimiter) Wait ¶
func (limiter *RequestLimiter) Wait()
Click to show internal directories.
Click to hide internal directories.