Documentation ¶
Index ¶
Constants ¶
View Source
const HTTPTimeout time.Duration = 20 * time.Second
Default HTTP timeout value to be set
View Source
const UserAgent = "Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0"
User agent to be used in all request
Variables ¶
This section is empty.
Functions ¶
func CheckStatus ¶
Types ¶
type DownloadReq ¶
type DownloadReq struct { Source string Dest string Client *http.Client Fs afero.Fs // contains filtered or unexported fields }
DownloadReq represent a request for downloading Source is the source URL. While Dest is the destination in disk
Use NewDownloadReq to create this struct
func NewDownloadReq ¶ added in v1.1.0
func NewDownloadReq(source string, dest string, client *http.Client, fs afero.Fs, log logrus.FieldLogger) *DownloadReq
Create a new download request. Note that creating the request will not start downloading. [fs] and log are optional.
func (*DownloadReq) DestExist ¶
func (meta *DownloadReq) DestExist() bool
DestExist checks if the file destination already has a file If true, the destination has a file. Exec should refuse to run
type WithHeaderTransport ¶
http.Transport with default header override
If `rt` field is nil, `http.DefaultTransport` will be used. Ref: https://stackoverflow.com/a/51326483/13226397
func NewWithHeaderTransport ¶
func NewWithHeaderTransport(rt http.RoundTripper) WithHeaderTransport
Click to show internal directories.
Click to hide internal directories.