page

package
v0.0.0-...-7a0d02b Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixUri

func FixUri(uri string) string

FixUri fixs uri like example.com/../../data.html, example.com/data//data.html

Types

type DefaultPageProcessor

type DefaultPageProcessor struct {
}

func (DefaultPageProcessor) Process

func (d DefaultPageProcessor) Process(req *request.Request, resp *http.Response) *Page

type Page

type Page struct {
	Req         *request.Request
	Cookies     []*http.Cookie
	StatusCode  int
	ContentType string
	OriCharset  string
	Err         string
	Failed      bool

	Raw     []byte
	Doc     *goquery.Document
	JsonMap map[string]string
	Body    string

	NewReqs []*http.Request
}

func New

func New(req *request.Request, res *http.Response) *Page

func (*Page) AddReq

func (p *Page) AddReq(req *http.Request)

func (*Page) Iconv

func (p *Page) Iconv(reader io.Reader) (io.Reader, error)

func (*Page) ParseHtml

func (p *Page) ParseHtml()

func (*Page) ParseJson

func (p *Page) ParseJson()

func (*Page) ParseText

func (p *Page) ParseText()

type PageProcessor

type PageProcessor interface {
	Process(req *request.Request, resp *http.Response) *Page
}

func NewPageProcessor

func NewPageProcessor() PageProcessor

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(processors []PageProcessor) *Pool

func (*Pool) Get

func (p *Pool) Get() PageProcessor

func (*Pool) Release

func (p *Pool) Release(processor PageProcessor)

func (*Pool) Total

func (p *Pool) Total() uint

func (*Pool) Used

func (p *Pool) Used() uint

Jump to

Keyboard shortcuts

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