Documentation
¶
Index ¶
Constants ¶
View Source
const ( FlagUnset = iota FlagPutBack FlagForbidden FlagDelete FlagFreeze )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
URL string
Index int // 序号,Proxy会被添加parallels次到poolCh中,用于区分
CreateTime time.Time // 创建时间
ExpiredTime time.Time // 过期时间
}
代理
type ProxyHelper ¶
type ProxyHelper struct {
// contains filtered or unexported fields
}
func (*ProxyHelper) Freeze ¶
func (p *ProxyHelper) Freeze(d time.Duration)
冻结当前代理一段时间,到期自动放回代理池(未过期、未在黑名单中)
type Reactor ¶
type Reactor struct {
Queue storage.Queue
Bucket storage.Bucket
Interval time.Duration
Retry int
// contains filtered or unexported fields
}
反应堆
func MustNewReactor ¶
func NewReactor ¶
type ReactorOpt ¶
type ReactorOpt struct {
// contains filtered or unexported fields
}
TODO: 彩色日志,区分时间、Reactor、Spider、Error、Warning 反应堆可选参数
func NewReactorOpt ¶
func NewReactorOpt() *ReactorOpt
func (*ReactorOpt) Debug ¶
func (r *ReactorOpt) Debug(enable bool) *ReactorOpt
func (*ReactorOpt) DownloadRetry ¶
func (r *ReactorOpt) DownloadRetry(i int) *ReactorOpt
func (*ReactorOpt) Interval ¶
func (r *ReactorOpt) Interval(d time.Duration) *ReactorOpt
func (*ReactorOpt) ProxyParallels ¶
func (r *ReactorOpt) ProxyParallels(i int) *ReactorOpt
func (*ReactorOpt) ProxyProviders ¶
func (r *ReactorOpt) ProxyProviders(p ...proxy.Provider) *ReactorOpt
Click to show internal directories.
Click to hide internal directories.