Documentation ¶
Index ¶
- Constants
- Variables
- type GuGo
- func (g *GuGo) GooGol()
- func (g *GuGo) NativeRequest(r *http.Request, parser Parser, meta map[string]interface{})
- func (g *GuGo) Pull() chan interface{}
- func (g *GuGo) Push(item interface{})
- func (g *GuGo) Request(url string, parser Parser, meta map[string]interface{})
- func (e GuGo) SetHearBeat(heartbeat time.Duration)
- func (e GuGo) SetMaxIdle(n uint64)
- type Parser
- type Response
- func (r *Response) Body() []byte
- func (r Response) FingerPrint() []byte
- func (r Response) FingerPrintS() string
- func (r Response) Host() string
- func (r *Response) Meta() map[string]interface{}
- func (r Response) Method() string
- func (r Response) Schema() string
- func (r *Response) Text() string
- func (r Response) URL() string
- func (r *Response) Valid() bool
- func (r *Response) XPath(selector string) *goquery.Selection
Constants ¶
View Source
const ( MaxRetry = 5 // 默认最大下载重试次数 ConnectTimeout = 10 * time.Second // 默认客户端连接超时时间 ReadWriteTimeout = 10 * time.Second // 默认客户端读写超时时间 )
View Source
const ( MaxIdle = 10 // 默认最大休眠次数 HeartBeat = time.Second // 默认心跳检测间隔时间 )
View Source
const ( PipelineBufCap = 1 << 12 // 默认数据队列容量 ConcurrentPipeline = 1 << 10 // 默认数据处理的并发量 )
View Source
const ( FalsePositive = 0.01 // 默认过滤错误容忍率 EstimateRequest = 1000000 // 默认估计100万请求 RequestBufferCap = 1 << 12 // 默认请求队列容量 ConcurrentRequest = 1 << 10 // 默认并发请求数 )
View Source
const ( ResponseBufCap = 1 << 12 // 默认响应队列容量 ConcurrentResponse = 1 << 10 // 默认响应处理的并发量 )
Variables ¶
View Source
var ( // RetryHTTPCode 默认请求失败时允许重新下载的状态码 RetryHTTPCode = []int{500, 502, 503, 504, 408} )
Functions ¶
This section is empty.
Types ¶
type GuGo ¶
type GuGo struct {
// contains filtered or unexported fields
}
func (*GuGo) NativeRequest ¶
NativeRequest 原生请求,客户端自定义
type Response ¶
func (Response) FingerPrint ¶
func (r Response) FingerPrint() []byte
FingerPrint 请求指纹:sha1(请求体+请求URL+请求方法)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.