components

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadStatusCodeError

type BadStatusCodeError struct {
	StatusCode int
}

BadStatusCodeError 是当响应的状态码并非 2xx 时返回的错误

func (BadStatusCodeError) Error

func (err BadStatusCodeError) Error() string

func (BadStatusCodeError) Temporary

func (err BadStatusCodeError) Temporary() bool

Temporary 返回此错误是否是临时性的

type HTTPResponseGoqueryDecorator

type HTTPResponseGoqueryDecorator struct{}

HTTPResponseGoqueryDecorator 将得到的 HTTP 响应中的 body 转换为 goquery 文档 响应的 body 应是 html/xml 文档

func (HTTPResponseGoqueryDecorator) DecoratePayload

func (HTTPResponseGoqueryDecorator) DecoratePayload(c *nyn.Crawler, _ nyn.Task, payload interface{}) (decoratedPayload interface{}, err error)

DecoratePayload 转换 payload

type HTTPResponseJSONDecorator

type HTTPResponseJSONDecorator struct{}

HTTPResponseJSONDecorator 将得到的 HTTP 响应中的 body 解析

func (HTTPResponseJSONDecorator) DecoratePayload

func (HTTPResponseJSONDecorator) DecoratePayload(c *nyn.Crawler, task nyn.Task, payload interface{}) (decoratedPayload interface{}, err error)

DecoratePayload 转换 payload

type HTTPURLGetFetcher

type HTTPURLGetFetcher struct {
}

HTTPURLGetFetcher 包装了 http url get 任务的 fetcher

func (HTTPURLGetFetcher) Fetch

func (HTTPURLGetFetcher) Fetch(c *nyn.Crawler, task nyn.Task) (payload interface{}, err error)

Fetch 获取内容 响应相关的问题/错误应该在这里处理

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL