Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPDownloader ¶
type HTTPDownloader struct {
// contains filtered or unexported fields
}
HTTPDownloader downloads a file from an HTTP server.
func NewHTTPDownloader ¶
func NewHTTPDownloader(client *http.Client, clientTimeOut time.Duration, maxFileSize int64) *HTTPDownloader
NewHTTPDownloader instantiates a new HTTPDownloader.
Requests will be time bound by clientTimeOut. Files bigger than maxFileSize will be rejected.
func (*HTTPDownloader) Download ¶
func (d *HTTPDownloader) Download(ctx context.Context, url string) (io.ReadCloser, error)
Download initiates a time constrained HTTP GET request, validates Content-Length and returns response body io.ReadCloser.
Click to show internal directories.
Click to hide internal directories.