-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from crawlab-team/develop
Develop
- Loading branch information
Showing
42 changed files
with
1,012 additions
and
733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package constants | ||
|
||
const ( | ||
ChannelAllNode = "nodes:public" | ||
|
||
ChannelWorkerNode = "nodes:" | ||
|
||
ChannelMasterNode = "nodes:master" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package entity | ||
|
||
import "strconv" | ||
|
||
type Page struct { | ||
Skip int | ||
Limit int | ||
PageNum int | ||
PageSize int | ||
} | ||
|
||
func (p *Page)GetPage(pageNum string, pageSize string) { | ||
p.PageNum, _ = strconv.Atoi(pageNum) | ||
p.PageSize, _ = strconv.Atoi(pageSize) | ||
p.Skip = p.PageSize * (p.PageNum - 1) | ||
p.Limit = p.PageSize | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package entity | ||
|
||
type NodeMessage struct { | ||
// 通信类别 | ||
Type string `json:"type"` | ||
|
||
// 任务相关 | ||
TaskId string `json:"task_id"` // 任务ID | ||
|
||
// 节点相关 | ||
NodeId string `json:"node_id"` // 节点ID | ||
|
||
// 日志相关 | ||
LogPath string `json:"log_path"` // 日志路径 | ||
Log string `json:"log"` // 日志 | ||
|
||
// 系统信息 | ||
SysInfo SystemInfo `json:"sys_info"` | ||
|
||
// 爬虫相关 | ||
SpiderId string `json:"spider_id"` //爬虫ID | ||
|
||
// 错误相关 | ||
Error string `json:"error"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package entity | ||
|
||
type SpiderType struct { | ||
Type string `json:"type" bson:"_id"` | ||
Count int `json:"count" bson:"count"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package entity | ||
|
||
type SystemInfo struct { | ||
ARCH string `json:"arch"` | ||
OS string `json:"os"` | ||
Hostname string `json:"host_name"` | ||
NumCpu int `json:"num_cpu"` | ||
Executables []Executable `json:"executables"` | ||
} | ||
|
||
type Executable struct { | ||
Path string `json:"path"` | ||
FileName string `json:"file_name"` | ||
DisplayName string `json:"display_name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.