maodou

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	CawlNoProxy = 0
	CawlProxy   = 1
	CawlRetry   = 2
)

Variables

View Source
var CYEAM_LOG = `` /* 403-byte string literal not displayed */

Functions

func Register

func Register(handler Handler)

Types

type App

type App struct {
	// contains filtered or unexported fields
}
var APP *App

func NewController

func NewController(handler Handler) *App

func (*App) Run

func (this *App) Run() error

type Handler

type Handler interface {
	Init(link string)
	Cawl(paras ...interface{}) (*Response, error)
	Start(link string) (*Response, error)
	Index(resp *Response, jobs chan string) error
	Detail(resp *Response) (*models.Result, error)
	Result(result *models.Result) error
	Config() *HandlerConfig
}

type HandlerConfig

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

type MaoDou

type MaoDou struct {
	Dao dao.DaoContainer

	Debug bool
	// contains filtered or unexported fields
}

func (*MaoDou) AddJob added in v1.0.4

func (this *MaoDou) AddJob(job string)

func (*MaoDou) Cawl

func (this *MaoDou) Cawl(paras ...interface{}) (*Response, error)

func (*MaoDou) Config

func (this *MaoDou) Config() *HandlerConfig

func (*MaoDou) Detail

func (this *MaoDou) Detail(resp *Response) (*models.Result, error)

func (*MaoDou) Index

func (this *MaoDou) Index(resp *Response, jobs chan string) error

func (*MaoDou) Init

func (this *MaoDou) Init(link string)

func (*MaoDou) Result

func (this *MaoDou) Result(result *models.Result) error

func (*MaoDou) SetD added in v1.0.4

func (this *MaoDou) SetD(d bool)

func (*MaoDou) SetDao

func (this *MaoDou) SetDao(dao_name, dsn string)

func (*MaoDou) SetJobLen added in v1.0.4

func (this *MaoDou) SetJobLen(l int)

func (*MaoDou) SetProxy

func (this *MaoDou) SetProxy(proxy_name, proxy_dsn string)

func (*MaoDou) SetRate

func (this *MaoDou) SetRate(times ...time.Duration)

func (*MaoDou) Start

func (this *MaoDou) Start(link string) (*Response, error)

type Request

type Request struct {
	goreq.Request

	Interval time.Duration
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(interval time.Duration) *Request

func (*Request) Cawl

func (this *Request) Cawl(paras ...interface{}) (*Response, error)

func (*Request) DumpRequest

func (this *Request) DumpRequest() string

func (*Request) InitProxy

func (this *Request) InitProxy(proxy_name, proxy_config string)

type Response

type Response struct {
	Url         string
	RawDocument *html.Node
	Document    *goquery.Document
}

func NewResponse

func NewResponse(r io.Reader, url string) (*Response, error)

func (*Response) Content

func (this *Response) Content(is_optimizatioin bool) string

func (*Response) Doc

func (this *Response) Doc(css string) *goquery.Selection

Directories

Path Synopsis
Package analytics https://stackoverflow.com/questions/12837748/analytics-google-api-error-403-user-does-not-have-any-google-analytics-account
Package analytics https://stackoverflow.com/questions/12837748/analytics-google-api-error-403-user-does-not-have-any-google-analytics-account
Package dao
Package dao
Package demo
Package demo

Jump to

Keyboard shortcuts

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