maodou

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	CAWL_NOPROXY = 0
	CAWL_PROXY   = 1
	CAWL_RETRY   = 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()
	Start()
	Index(resp *Response)
	Detail(resp *Response)
	Result(result *models.Result)
	Config() *HandlerConfig
	Route(http_method, route string, function func(w http.ResponseWriter, req *http.Request))
	Serve(ip string, port int, graceful_timeout int)
	Log(format string, a ...interface{})
}

type HandlerConfig

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

type MaoDou

type MaoDou struct {
	Dao dao.DaoContainer

	// supervisor *supervisor.SupervisorController
	Debug bool
	// contains filtered or unexported fields
}

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)

func (*MaoDou) Index

func (this *MaoDou) Index(resp *Response)

func (*MaoDou) Init

func (this *MaoDou) Init()

func (*MaoDou) Log

func (this *MaoDou) Log(format string, a ...interface{})

func (*MaoDou) Result

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

func (*MaoDou) Route

func (this *MaoDou) Route(http_method, route string, function func(w http.ResponseWriter, req *http.Request))

func (*MaoDou) Serve

func (this *MaoDou) Serve(ip string, port int, graceful_timeout int)

func (*MaoDou) SetDao

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

func (*MaoDou) SetProxy

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

func (*MaoDou) SetRate

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

func (*MaoDou) SetServe

func (this *MaoDou) SetServe(ip string, port int, graceful_timeout int)

func (*MaoDou) Start

func (this *MaoDou) Start()

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 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