Documentation
¶
Index ¶
- func UrlEncode(urlStr string) (*url.URL, error)
- type DefaultDownloader
- type DnsCache
- type Downloader
- type ImrocDownloader
- type Param
- type Request
- func (r *Request) GetConnTimeout() time.Duration
- func (r *Request) GetDialTimeout() time.Duration
- func (r *Request) GetMethod() (s string)
- func (r *Request) GetProxy() (s string)
- func (r *Request) GetRedirectTimes() int
- func (r *Request) GetRetry() (b bool, times int)
- func (r *Request) GetRetryPause() time.Duration
- func (r *Request) GetTryTimes() int
- func (r *Request) SetMethod(s string) *Request
- func (r *Request) SetProxy(s string) *Request
- func (r *Request) SetRetry(b bool, times int) *Request
- type RestyDownloader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultDownloader ¶
type DnsCache ¶
type DnsCache struct {
// contains filtered or unexported fields
}
DnsCache DNS cache
type Downloader ¶
func New ¶
func New(cookie ...*cookiejar.Jar) Downloader
func NewImroc ¶
func NewImroc(cookie *cookiejar.Jar) Downloader
func NewResty ¶
func NewResty(cookie *cookiejar.Jar) Downloader
type ImrocDownloader ¶
type Request ¶
type Request struct {
Rule string
Url string // url域名
Header http.Header
PostData string // 参数
// 是否使用cookies,在Spider的EnableCookie设置
EnableCookie bool
// dial tcp: i/o timeout
DialTimeout time.Duration
// WSARecv tcp: i/o timeout
ConnTimeout time.Duration
// the max times of download
TryTimes int
// how long pause when retry
RetryPause time.Duration
// max redirect times
// when RedirectTimes equal 0, redirect times is ∞
// when RedirectTimes less than 0, redirect times is 0
RedirectTimes int
Cloudflare bool
JsEnable bool
JsFunc func(request *Request) (*http.Response, error)
// contains filtered or unexported fields
}
func (*Request) GetConnTimeout ¶
WSARecv tcp: i/o timeout
func (*Request) GetDialTimeout ¶
dial tcp: i/o timeout
func (*Request) GetRetryPause ¶
the pause time of retry
Source Files
¶
Click to show internal directories.
Click to hide internal directories.