示例#1
0
文件: node.go 项目: keepWork/pholcus
func newPholcus() *Node {
	return &Node{
		RunMode:  cache.Task.RunMode,
		Port:     ":" + strconv.Itoa(cache.Task.Port),
		Master:   cache.Task.Master,
		Teleport: teleport.New(),
		TaskJar:  task.NewTaskJar(),
		Spiders:  spiderqueue.New(),
		Crawls:   crawlpool.New(),
		Status:   status.RUN,
	}
}
示例#2
0
文件: node.go 项目: npk/pholcus-1
func NewNode(mode int, port int, master string) *Node {
	return &Node{
		RunMode:  mode,
		Port:     ":" + strconv.Itoa(port),
		Master:   master,
		Teleport: teleport.New(),
		TaskJar:  task.NewTaskJar(),
		Spiders:  spiderqueue.New(),
		Crawls:   crawlpool.New(),
		Status:   status.RUN,
	}
}