pkg

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TabExecuteTimeout time.Duration
	DomLoadTimeout    time.Duration
)
View Source
var ResultAll = &Result{}

Functions

func InitLogger

func InitLogger(levelStr string) *logrus.Logger

func ParseURL

func ParseURL(rawURL string) *url.URL

func RunWithTimeOut

func RunWithTimeOut(ctx *context.Context, timeout time.Duration, tasks chromedp.Tasks) chromedp.ActionFunc

func WriteFile

func WriteFile(fileName string, content []byte)

Types

type Browser

type Browser struct {
	ChromiumPath string
	Headless     bool
	ExtraHeaders map[string]interface{}
	Proxy        string
	// contains filtered or unexported fields
}

func (*Browser) Close

func (b *Browser) Close()

func (*Browser) Init

func (b *Browser) Init()

type Pool

type Pool struct {
	Capacity int

	MaxPageVisitNum int
	// contains filtered or unexported fields
}

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) Init

func (p *Pool) Init()

func (*Pool) Run

func (p *Pool) Run(task *Task)

type Request

type Request struct {
	URL     *url.URL
	Method  string
	Headers map[string]interface{}
	Data    string
	Source  string
}

type Result

type Result struct {
	AllResult  []*Request
	TaskResult []*Request
	// contains filtered or unexported fields
}

type Tab

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

func (*Tab) Run

func (tab *Tab) Run(browser *Browser, req *Request) []*Request

type Task

type Task struct {
	Pool    *Pool
	Browser *Browser
	Request *Request
	// contains filtered or unexported fields
}
var TaskContext *Task

Jump to

Keyboard shortcuts

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