Documentation
¶
Overview ¶
Package cache provides common configuration and cache for task runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StartTime time.Time // timestamp when start button was clicked ReportChan chan *Report // text data summary report channel )
View Source
var Task = new(AppConf)
Task holds the default runtime configuration.
Functions ¶
func GetPageCount ¶
GetPageCount returns page counts: i>0 returns success count, i<0 returns failure count, i==0 returns total.
Types ¶
type AppConf ¶
type AppConf struct {
Mode int // node role
Port int // master node port
Master string // master node address (without port)
ThreadNum int // global max concurrency
Pausetime int64 // pause duration reference in ms (random: Pausetime/2 ~ Pausetime*2)
OutType string // output method
BatchCap int // batch output capacity per flush
Limit int64 // crawl limit; 0 means unlimited; if set to LIMIT in rules, uses custom limit; otherwise defaults to request count limit
ProxyMinute int64 // proxy IP rotation interval in minutes
SuccessInherit bool // inherit historical success records
FailureInherit bool // inherit historical failure records
Keyins string // custom input; later split into Keyin config for multiple tasks
}
AppConf holds the common configuration for task runtime.
Click to show internal directories.
Click to hide internal directories.