Documentation
¶
Index ¶
- Variables
- func GetModelColName(id interfaces.ModelId) (colName string)
- type Artifact
- func (a *Artifact) GetId() (id primitive.ObjectID)
- func (a *Artifact) GetSys() (sys interfaces.ModelArtifactSys)
- func (a *Artifact) GetTagIds() (ids []primitive.ObjectID)
- func (a *Artifact) SetDel(del bool)
- func (a *Artifact) SetId(id primitive.ObjectID)
- func (a *Artifact) SetObj(obj interfaces.Model)
- func (a *Artifact) SetTagIds(ids []primitive.ObjectID)
- type ArtifactList
- type ArtifactSys
- func (sys *ArtifactSys) GetCreateTs() time.Time
- func (sys *ArtifactSys) GetCreateUid() primitive.ObjectID
- func (sys *ArtifactSys) GetDeleteTs() time.Time
- func (sys *ArtifactSys) GetDeleteUid() primitive.ObjectID
- func (sys *ArtifactSys) GetUpdateTs() time.Time
- func (sys *ArtifactSys) GetUpdateUid() primitive.ObjectID
- func (sys *ArtifactSys) SetCreateTs(ts time.Time)
- func (sys *ArtifactSys) SetCreateUid(id primitive.ObjectID)
- func (sys *ArtifactSys) SetDeleteTs(ts time.Time)
- func (sys *ArtifactSys) SetDeleteUid(id primitive.ObjectID)
- func (sys *ArtifactSys) SetUpdateTs(ts time.Time)
- func (sys *ArtifactSys) SetUpdateUid(id primitive.ObjectID)
- type BaseModel
- type DataCollection
- type DataCollectionList
- type DataField
- type DataSource
- type DataSourceList
- type Env
- type ExtraValue
- func (ev *ExtraValue) GetId() (id primitive.ObjectID)
- func (ev *ExtraValue) GetModel() (m string)
- func (ev *ExtraValue) GetObjectId() (oid primitive.ObjectID)
- func (ev *ExtraValue) GetType() (t string)
- func (ev *ExtraValue) GetValue() (v interface{})
- func (ev *ExtraValue) SetId(id primitive.ObjectID)
- func (ev *ExtraValue) SetModel(m string)
- func (ev *ExtraValue) SetObjectId(oid primitive.ObjectID)
- func (ev *ExtraValue) SetType(t string)
- func (ev *ExtraValue) SetValue(v interface{})
- type ExtraValueList
- type Git
- type GitList
- type Job
- type JobList
- type ModelListMap
- type ModelMap
- type Node
- func (n *Node) DecrementAvailableRunners()
- func (n *Node) GetActive() (active bool)
- func (n *Node) GetAvailableRunners() (runners int)
- func (n *Node) GetEnabled() (enabled bool)
- func (n *Node) GetId() (id primitive.ObjectID)
- func (n *Node) GetIsMaster() (ok bool)
- func (n *Node) GetKey() (key string)
- func (n *Node) GetMaxRunners() (runners int)
- func (n *Node) GetName() (name string)
- func (n *Node) GetStatus() (status string)
- func (n *Node) IncrementAvailableRunners()
- func (n *Node) SetActive(active bool)
- func (n *Node) SetActiveTs(activeTs time.Time)
- func (n *Node) SetAvailableRunners(runners int)
- func (n *Node) SetEnabled(enabled bool)
- func (n *Node) SetId(id primitive.ObjectID)
- func (n *Node) SetMaxRunners(runners int)
- func (n *Node) SetStatus(status string)
- type NodeList
- type Password
- type PasswordList
- type Plugin
- func (p *Plugin) GetFullName() (fullName string)
- func (p *Plugin) GetId() (id primitive.ObjectID)
- func (p *Plugin) GetInstallCmd() (cmd string)
- func (p *Plugin) GetInstallType() (t string)
- func (p *Plugin) GetInstallUrl() (url string)
- func (p *Plugin) GetName() (name string)
- func (p *Plugin) SetFullName(fullName string)
- func (p *Plugin) SetId(id primitive.ObjectID)
- func (p *Plugin) SetInstallCmd(cmd string)
- func (p *Plugin) SetInstallType(t string)
- func (p *Plugin) SetInstallUrl(url string)
- func (p *Plugin) SetName(name string)
- type PluginList
- type PluginStatus
- func (ps *PluginStatus) GetError() (e string)
- func (ps *PluginStatus) GetId() (id primitive.ObjectID)
- func (ps *PluginStatus) GetNodeId() (id primitive.ObjectID)
- func (ps *PluginStatus) GetPid() (pid int)
- func (ps *PluginStatus) GetPluginId() (id primitive.ObjectID)
- func (ps *PluginStatus) GetStatus() (status string)
- func (ps *PluginStatus) SetError(e string)
- func (ps *PluginStatus) SetId(id primitive.ObjectID)
- func (ps *PluginStatus) SetNodeId(id primitive.ObjectID)
- func (ps *PluginStatus) SetPid(pid int)
- func (ps *PluginStatus) SetPluginId(id primitive.ObjectID)
- func (ps *PluginStatus) SetStatus(status string)
- type PluginStatusList
- type Project
- type ProjectList
- type Result
- func (r *Result) GetId() (id primitive.ObjectID)
- func (r *Result) GetTaskId() (id primitive.ObjectID)
- func (r *Result) GetValue(key string) (value interface{})
- func (r *Result) SetId(id primitive.ObjectID)
- func (r *Result) SetTaskId(id primitive.ObjectID)
- func (r *Result) SetValue(key string, value interface{})
- func (r *Result) Value() map[string]interface{}
- type ResultList
- type Schedule
- func (s *Schedule) GetCmd() (cmd string)
- func (s *Schedule) GetCron() (c string)
- func (s *Schedule) GetEnabled() (enabled bool)
- func (s *Schedule) GetEntryId() (id cron.EntryID)
- func (s *Schedule) GetId() (id primitive.ObjectID)
- func (s *Schedule) GetMode() (mode string)
- func (s *Schedule) GetNodeIds() (ids []primitive.ObjectID)
- func (s *Schedule) GetParam() (param string)
- func (s *Schedule) GetPriority() (p int)
- func (s *Schedule) GetSpiderId() (id primitive.ObjectID)
- func (s *Schedule) SetCmd(cmd string)
- func (s *Schedule) SetCron(c string)
- func (s *Schedule) SetEnabled(enabled bool)
- func (s *Schedule) SetEntryId(id cron.EntryID)
- func (s *Schedule) SetId(id primitive.ObjectID)
- func (s *Schedule) SetMode(mode string)
- func (s *Schedule) SetNodeIds(ids []primitive.ObjectID)
- func (s *Schedule) SetParam(param string)
- func (s *Schedule) SetPriority(p int)
- func (s *Schedule) SetSpiderId(id primitive.ObjectID)
- type ScheduleList
- type Setting
- type SettingList
- type Spider
- func (s *Spider) GetCmd() (cmd string)
- func (s *Spider) GetColId() (id primitive.ObjectID)
- func (s *Spider) GetId() (id primitive.ObjectID)
- func (s *Spider) GetMode() (mode string)
- func (s *Spider) GetName() (n string)
- func (s *Spider) GetNodeIds() (ids []primitive.ObjectID)
- func (s *Spider) GetParam() (param string)
- func (s *Spider) GetPriority() (p int)
- func (s *Spider) GetType() (ty string)
- func (s *Spider) SetCmd(cmd string)
- func (s *Spider) SetColId(id primitive.ObjectID)
- func (s *Spider) SetId(id primitive.ObjectID)
- func (s *Spider) SetMode(mode string)
- func (s *Spider) SetNodeIds(ids []primitive.ObjectID)
- func (s *Spider) SetParam(param string)
- func (s *Spider) SetPriority(p int)
- type SpiderList
- type SpiderStat
- type SpiderStatList
- type Tag
- type TagList
- type Task
- func (t *Task) GetCmd() (cmd string)
- func (t *Task) GetError() (error string)
- func (t *Task) GetId() (id primitive.ObjectID)
- func (t *Task) GetNodeId() (id primitive.ObjectID)
- func (t *Task) GetNodeIds() (ids []primitive.ObjectID)
- func (t *Task) GetParam() (param string)
- func (t *Task) GetPid() (pid int)
- func (t *Task) GetPriority() (p int)
- func (t *Task) GetSpiderId() (id primitive.ObjectID)
- func (t *Task) GetStatus() (status string)
- func (t *Task) GetType() (ty string)
- func (t *Task) GetUserId() (id primitive.ObjectID)
- func (t *Task) SetError(error string)
- func (t *Task) SetId(id primitive.ObjectID)
- func (t *Task) SetNodeId(id primitive.ObjectID)
- func (t *Task) SetPid(pid int)
- func (t *Task) SetStatus(status string)
- func (t *Task) SetUserId(id primitive.ObjectID)
- type TaskDailyItem
- type TaskList
- type TaskQueueItem
- type TaskQueueItemList
- type TaskStat
- func (s *TaskStat) GetCreateTs() (ts time.Time)
- func (s *TaskStat) GetEndTs() (ts time.Time)
- func (s *TaskStat) GetErrorLogCount() (c int64)
- func (s *TaskStat) GetId() (id primitive.ObjectID)
- func (s *TaskStat) GetResultCount() (c int64)
- func (s *TaskStat) GetRuntimeDuration() (d int64)
- func (s *TaskStat) GetStartTs() (ts time.Time)
- func (s *TaskStat) GetTotalDuration() (d int64)
- func (s *TaskStat) GetWaitDuration() (d int64)
- func (s *TaskStat) SetCreateTs(ts time.Time)
- func (s *TaskStat) SetEndTs(ts time.Time)
- func (s *TaskStat) SetErrorLogCount(c int64)
- func (s *TaskStat) SetId(id primitive.ObjectID)
- func (s *TaskStat) SetResultCount(c int64)
- func (s *TaskStat) SetRuntimeDuration(d int64)
- func (s *TaskStat) SetStartTs(ts time.Time)
- func (s *TaskStat) SetTotalDuration(d int64)
- func (s *TaskStat) SetWaitDuration(d int64)
- type TaskStatList
- type Token
- type TokenList
- type User
- type UserList
- type Variable
- type VariableList
Constants ¶
This section is empty.
Variables ¶
View Source
var ModelRelations = []modelRelation{ {/* contains filtered or unexported fields */}, {/* contains filtered or unexported fields */}, }
Functions ¶
func GetModelColName ¶
func GetModelColName(id interfaces.ModelId) (colName string)
Types ¶
type Artifact ¶
type Artifact struct {
Id primitive.ObjectID `bson:"_id" json:"_id"`
Col string `bson:"_col" json:"_col"`
Del bool `bson:"_del" json:"_del"`
TagIds []primitive.ObjectID `bson:"_tid" json:"_tid"`
Sys *ArtifactSys `bson:"_sys" json:"_sys"`
Obj interface{} `bson:"_obj" json:"_obj"`
}
func (*Artifact) GetSys ¶
func (a *Artifact) GetSys() (sys interfaces.ModelArtifactSys)
func (*Artifact) SetObj ¶
func (a *Artifact) SetObj(obj interfaces.Model)
type ArtifactList ¶
type ArtifactList []Artifact
func (*ArtifactList) GetModels ¶
func (l *ArtifactList) GetModels() (res []interfaces.Model)
type ArtifactSys ¶
type ArtifactSys struct {
CreateTs time.Time `json:"create_ts" bson:"create_ts"`
CreateUid primitive.ObjectID `json:"create_uid" bson:"create_uid"`
UpdateTs time.Time `json:"update_ts" bson:"update_ts"`
UpdateUid primitive.ObjectID `json:"update_uid" bson:"update_uid"`
DeleteTs time.Time `json:"delete_ts" bson:"delete_ts"`
DeleteUid primitive.ObjectID `json:"delete_uid" bson:"delete_uid"`
}
func (*ArtifactSys) GetCreateTs ¶
func (sys *ArtifactSys) GetCreateTs() time.Time
func (*ArtifactSys) GetCreateUid ¶
func (sys *ArtifactSys) GetCreateUid() primitive.ObjectID
func (*ArtifactSys) GetDeleteTs ¶
func (sys *ArtifactSys) GetDeleteTs() time.Time
func (*ArtifactSys) GetDeleteUid ¶
func (sys *ArtifactSys) GetDeleteUid() primitive.ObjectID
func (*ArtifactSys) GetUpdateTs ¶
func (sys *ArtifactSys) GetUpdateTs() time.Time
func (*ArtifactSys) GetUpdateUid ¶
func (sys *ArtifactSys) GetUpdateUid() primitive.ObjectID
func (*ArtifactSys) SetCreateTs ¶
func (sys *ArtifactSys) SetCreateTs(ts time.Time)
func (*ArtifactSys) SetCreateUid ¶
func (sys *ArtifactSys) SetCreateUid(id primitive.ObjectID)
func (*ArtifactSys) SetDeleteTs ¶
func (sys *ArtifactSys) SetDeleteTs(ts time.Time)
func (*ArtifactSys) SetDeleteUid ¶
func (sys *ArtifactSys) SetDeleteUid(id primitive.ObjectID)
func (*ArtifactSys) SetUpdateTs ¶
func (sys *ArtifactSys) SetUpdateTs(ts time.Time)
func (*ArtifactSys) SetUpdateUid ¶
func (sys *ArtifactSys) SetUpdateUid(id primitive.ObjectID)
type DataCollection ¶
type DataCollection struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
}
func (*DataCollection) GetId ¶
func (dc *DataCollection) GetId() (id primitive.ObjectID)
func (*DataCollection) SetId ¶
func (dc *DataCollection) SetId(id primitive.ObjectID)
type DataCollectionList ¶
type DataCollectionList []DataCollection
func (*DataCollectionList) GetModels ¶
func (l *DataCollectionList) GetModels() (res []interfaces.Model)
type DataSource ¶
type DataSource struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Type string `json:"type" bson:"type"`
Description string `json:"description" bson:"description"`
Host string `json:"host" bson:"host"`
Port string `json:"port" bson:"port"`
Url string `json:"url" bson:"url"`
Hosts []string `json:"hosts" bson:"hosts"`
Database string `json:"database" bson:"database"`
Username string `json:"username" bson:"username"`
Password string `json:"password,omitempty" bson:"-"`
ConnectType string `json:"connect_type" bson:"connect_type"`
Status string `json:"status" bson:"status"`
Error string `json:"error" bson:"error"`
Extra map[string]string `json:"extra,omitempty" bson:"extra,omitempty"`
}
func (*DataSource) GetId ¶
func (ds *DataSource) GetId() (id primitive.ObjectID)
func (*DataSource) SetId ¶
func (ds *DataSource) SetId(id primitive.ObjectID)
type DataSourceList ¶
type DataSourceList []DataSource
func (*DataSourceList) GetModels ¶
func (l *DataSourceList) GetModels() (res []interfaces.Model)
type ExtraValue ¶
type ExtraValue struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
ObjectId primitive.ObjectID `json:"oid" bson:"oid"`
Model string `json:"model" bson:"m"`
Type string `json:"type" bson:"t"`
Value interface{} `json:"value" bson:"v"`
}
func (*ExtraValue) GetId ¶
func (ev *ExtraValue) GetId() (id primitive.ObjectID)
func (*ExtraValue) GetModel ¶
func (ev *ExtraValue) GetModel() (m string)
func (*ExtraValue) GetObjectId ¶
func (ev *ExtraValue) GetObjectId() (oid primitive.ObjectID)
func (*ExtraValue) GetType ¶
func (ev *ExtraValue) GetType() (t string)
func (*ExtraValue) GetValue ¶
func (ev *ExtraValue) GetValue() (v interface{})
func (*ExtraValue) SetId ¶
func (ev *ExtraValue) SetId(id primitive.ObjectID)
func (*ExtraValue) SetModel ¶
func (ev *ExtraValue) SetModel(m string)
func (*ExtraValue) SetObjectId ¶
func (ev *ExtraValue) SetObjectId(oid primitive.ObjectID)
func (*ExtraValue) SetType ¶
func (ev *ExtraValue) SetType(t string)
func (*ExtraValue) SetValue ¶
func (ev *ExtraValue) SetValue(v interface{})
type ExtraValueList ¶
type ExtraValueList []ExtraValue
func (*ExtraValueList) GetModels ¶
func (l *ExtraValueList) GetModels() (res []interfaces.Model)
type Git ¶
type GitList ¶
type GitList []Git
func (*GitList) GetModels ¶
func (l *GitList) GetModels() (res []interfaces.Model)
type Job ¶
type JobList ¶
type JobList []Job
func (*JobList) GetModels ¶
func (l *JobList) GetModels() (res []interfaces.Model)
type ModelListMap ¶
type ModelListMap struct {
Artifacts ArtifactList
Tags TagList
Nodes NodeList
Projects ProjectList
Spiders SpiderList
Tasks TaskList
Jobs JobList
Schedules ScheduleList
Users UserList
Settings SettingList
Tokens TokenList
Variables VariableList
TaskQueueItems TaskQueueItemList
TaskStats TaskStatList
Plugins PluginList
SpiderStats SpiderStatList
DataSources DataSourceList
DataCollections DataCollectionList
Results ResultList
Passwords PasswordList
ExtraValues ExtraValueList
PluginStatus PluginStatusList
Gits GitList
}
func NewModelListMap ¶
func NewModelListMap() (m *ModelListMap)
type ModelMap ¶
type ModelMap struct {
Artifact Artifact
Tag Tag
Node Node
Project Project
Spider Spider
Task Task
Job Job
Schedule Schedule
User User
Setting Setting
Token Token
Variable Variable
TaskQueueItem TaskQueueItem
TaskStat TaskStat
Plugin Plugin
SpiderStat SpiderStat
DataSource DataSource
DataCollection DataCollection
Result Result
Password Password
ExtraValue ExtraValue
PluginStatus PluginStatus
Git Git
}
func NewModelMap ¶
func NewModelMap() (m *ModelMap)
type Node ¶
type Node struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Key string `json:"key" bson:"key"`
Name string `json:"name" bson:"name"`
Ip string `json:"ip" bson:"ip"`
Port string `json:"port" bson:"port"`
Mac string `json:"mac" bson:"mac"`
Hostname string `json:"hostname" bson:"hostname"`
Description string `json:"description" bson:"description"`
IsMaster bool `json:"is_master" bson:"is_master"`
Status string `json:"status" bson:"status"`
Enabled bool `json:"enabled" bson:"enabled"`
Active bool `json:"active" bson:"active"`
ActiveTs time.Time `json:"active_ts" bson:"active_ts"`
AvailableRunners int `json:"available_runners" bson:"available_runners"`
MaxRunners int `json:"max_runners" bson:"max_runners"`
}
func (*Node) DecrementAvailableRunners ¶
func (n *Node) DecrementAvailableRunners()
func (*Node) GetAvailableRunners ¶
func (*Node) GetEnabled ¶
func (*Node) GetIsMaster ¶
func (*Node) GetMaxRunners ¶
func (*Node) IncrementAvailableRunners ¶
func (n *Node) IncrementAvailableRunners()
func (*Node) SetActiveTs ¶
func (*Node) SetAvailableRunners ¶
func (*Node) SetEnabled ¶
func (*Node) SetMaxRunners ¶
type NodeList ¶
type NodeList []Node
func (*NodeList) GetModels ¶
func (l *NodeList) GetModels() (res []interfaces.Model)
type Password ¶
type PasswordList ¶
type PasswordList []Password
func (*PasswordList) GetModels ¶
func (l *PasswordList) GetModels() (res []interfaces.Model)
type Plugin ¶
type Plugin struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
FullName string `json:"full_name" bson:"full_name"`
Description string `json:"description" bson:"description"`
Proto string `json:"proto" bson:"proto"`
Active bool `json:"active" bson:"active"`
Endpoint string `json:"endpoint" bson:"endpoint"`
Cmd string `json:"cmd" bson:"cmd"`
EventKey entity.PluginEventKey `json:"event_key" bson:"event_key"`
InstallType string `json:"install_type" bson:"install_type"`
InstallUrl string `json:"install_url" bson:"install_url"`
InstallCmd string `json:"install_cmd" bson:"install_cmd"`
DeployMode string `json:"deploy_mode" bson:"deploy_mode"`
AutoStart bool `json:"auto_start" bson:"auto_start"`
UIComponents []entity.PluginUIComponent `json:"ui_components" bson:"ui_components"`
UIAssets []entity.PluginUIAsset `json:"ui_assets" bson:"ui_assets"`
LangUrl string `json:"lang_url" bson:"lang_url"`
Status []PluginStatus `json:"status" bson:"-"`
}
func (*Plugin) GetFullName ¶
func (*Plugin) GetInstallCmd ¶
func (*Plugin) GetInstallType ¶
func (*Plugin) GetInstallUrl ¶
func (*Plugin) SetFullName ¶
func (*Plugin) SetInstallCmd ¶
func (*Plugin) SetInstallType ¶
func (*Plugin) SetInstallUrl ¶
type PluginList ¶
type PluginList []Plugin
func (*PluginList) GetModels ¶
func (l *PluginList) GetModels() (res []interfaces.Model)
type PluginStatus ¶
type PluginStatus struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
PluginId primitive.ObjectID `json:"plugin_id" bson:"plugin_id"`
NodeId primitive.ObjectID `json:"node_id" bson:"node_id"`
Status string `json:"status" bson:"status"`
Pid int `json:"pid" bson:"pid"`
Error string `json:"error" bson:"error"`
Node *Node `json:"node,omitempty" bson:"-"`
}
func (*PluginStatus) GetError ¶
func (ps *PluginStatus) GetError() (e string)
func (*PluginStatus) GetId ¶
func (ps *PluginStatus) GetId() (id primitive.ObjectID)
func (*PluginStatus) GetNodeId ¶
func (ps *PluginStatus) GetNodeId() (id primitive.ObjectID)
func (*PluginStatus) GetPid ¶
func (ps *PluginStatus) GetPid() (pid int)
func (*PluginStatus) GetPluginId ¶
func (ps *PluginStatus) GetPluginId() (id primitive.ObjectID)
func (*PluginStatus) GetStatus ¶
func (ps *PluginStatus) GetStatus() (status string)
func (*PluginStatus) SetError ¶
func (ps *PluginStatus) SetError(e string)
func (*PluginStatus) SetId ¶
func (ps *PluginStatus) SetId(id primitive.ObjectID)
func (*PluginStatus) SetNodeId ¶
func (ps *PluginStatus) SetNodeId(id primitive.ObjectID)
func (*PluginStatus) SetPid ¶
func (ps *PluginStatus) SetPid(pid int)
func (*PluginStatus) SetPluginId ¶
func (ps *PluginStatus) SetPluginId(id primitive.ObjectID)
func (*PluginStatus) SetStatus ¶
func (ps *PluginStatus) SetStatus(status string)
type PluginStatusList ¶
type PluginStatusList []PluginStatus
func (*PluginStatusList) GetModels ¶
func (l *PluginStatusList) GetModels() (res []interfaces.Model)
type Project ¶
type ProjectList ¶
type ProjectList []Project
func (*ProjectList) GetModels ¶
func (l *ProjectList) GetModels() (res []interfaces.Model)
type ResultList ¶
type ResultList []Result
func (*ResultList) GetModels ¶
func (l *ResultList) GetModels() (res []interfaces.Model)
type Schedule ¶
type Schedule struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
SpiderId primitive.ObjectID `json:"spider_id" bson:"spider_id"`
Cron string `json:"cron" bson:"cron"`
EntryId cron.EntryID `json:"entry_id" bson:"entry_id"`
Cmd string `json:"cmd" bson:"cmd"`
Param string `json:"param" bson:"param"`
Mode string `json:"mode" bson:"mode"`
NodeIds []primitive.ObjectID `json:"node_ids" bson:"node_ids"`
Priority int `json:"priority" bson:"priority"`
Enabled bool `json:"enabled" bson:"enabled"`
UserId primitive.ObjectID `json:"user_id" bson:"user_id"`
ScrapySpider string `json:"scrapy_spider" bson:"scrapy_spider"`
ScrapyLogLevel string `json:"scrapy_log_level" bson:"scrapy_log_level"`
}
func (*Schedule) GetEnabled ¶
func (*Schedule) GetEntryId ¶
func (*Schedule) GetNodeIds ¶
func (*Schedule) GetPriority ¶
func (*Schedule) GetSpiderId ¶
func (*Schedule) SetEnabled ¶
func (*Schedule) SetEntryId ¶
func (*Schedule) SetNodeIds ¶
func (*Schedule) SetPriority ¶
func (*Schedule) SetSpiderId ¶
type ScheduleList ¶
type ScheduleList []Schedule
func (*ScheduleList) GetModels ¶
func (l *ScheduleList) GetModels() (res []interfaces.Model)
type Setting ¶
type SettingList ¶
type SettingList []Setting
func (*SettingList) GetModels ¶
func (l *SettingList) GetModels() (res []interfaces.Model)
type Spider ¶
type Spider struct {
Id primitive.ObjectID `json:"_id" bson:"_id"` // spider id
Name string `json:"name" bson:"name"` // spider name
Type string `json:"type" bson:"type"` // spider type
ColId primitive.ObjectID `json:"col_id" bson:"col_id"` // data collection id
ColName string `json:"col_name,omitempty" bson:"-"` // data collection name
DataSourceId primitive.ObjectID `json:"data_source_id" bson:"data_source_id"` // data source id
DataSource *DataSource `json:"data_source,omitempty" bson:"-"` // data source
Description string `json:"description" bson:"description"` // description
ProjectId primitive.ObjectID `json:"project_id" bson:"project_id"` // Project.Id
Mode string `json:"mode" bson:"mode"` // default Task.Mode
NodeIds []primitive.ObjectID `json:"node_ids" bson:"node_ids"` // default Task.NodeIds
Stat *SpiderStat `json:"stat,omitempty" bson:"-"`
GitId primitive.ObjectID `json:"git_id" bson:"git_id"`
IsPublic bool `json:"is_public" bson:"is_public"` // 是否公开
Envs []Env `json:"envs" bson:"envs"` // 环境变量
// 自定义爬虫
Cmd string `json:"cmd" bson:"cmd"` // 执行命令
Param string `json:"param" bson:"param"` // default task param
Priority int `json:"priority" bson:"priority"`
// Scrapy 爬虫(属于自定义爬虫)
IsScrapy bool `json:"is_scrapy" bson:"is_scrapy"` // 是否为 Scrapy 爬虫
SpiderNames []string `json:"spider_names" bson:"spider_names"` // 爬虫名称列表
// 可配置爬虫
Template string `json:"template" bson:"template"` // Spiderfile模版
// Git 设置
IsGit bool `json:"is_git" bson:"is_git"` // 是否为 Git
GitUrl string `json:"git_url" bson:"git_url"` // Git URL
GitBranch string `json:"git_branch" bson:"git_branch"` // Git 分支
GitHasCredential bool `json:"git_has_credential" bson:"git_has_credential"` // Git 是否加密
GitUsername string `json:"git_username" bson:"git_username"` // Git 用户名
GitPassword string `json:"git_password" bson:"git_password"` // Git 密码
GitAutoSync bool `json:"git_auto_sync" bson:"git_auto_sync"` // Git 是否自动同步
GitSyncFrequency string `json:"git_sync_frequency" bson:"git_sync_frequency"` // Git 同步频率
GitSyncError string `json:"git_sync_error" bson:"git_sync_error"` // Git 同步错误
// 长任务
IsLongTask bool `json:"is_long_task" bson:"is_long_task"` // 是否为长任务
// 去重
IsDedup bool `json:"is_dedup" bson:"is_dedup"` // 是否去重
DedupField string `json:"dedup_field" bson:"dedup_field"` // 去重字段
DedupMethod string `json:"dedup_method" bson:"dedup_method"` // 去重方式
// Web Hook
IsWebHook bool `json:"is_web_hook" bson:"is_web_hook"` // 是否开启 Web Hook
WebHookUrl string `json:"web_hook_url" bson:"web_hook_url"` // Web Hook URL
}
func (*Spider) GetNodeIds ¶
func (*Spider) GetPriority ¶
func (*Spider) SetNodeIds ¶
func (*Spider) SetPriority ¶
type SpiderList ¶
type SpiderList []Spider
func (*SpiderList) GetModels ¶
func (l *SpiderList) GetModels() (res []interfaces.Model)
type SpiderStat ¶
type SpiderStat struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
LastTaskId primitive.ObjectID `json:"last_task_id" bson:"last_task_id,omitempty"`
LastTask *Task `json:"last_task,omitempty" bson:"-"`
Tasks int `json:"tasks" bson:"tasks"`
Results int `json:"results" bson:"results"`
WaitDuration int64 `json:"wait_duration" bson:"wait_duration,omitempty"` // in second
RuntimeDuration int64 `json:"runtime_duration" bson:"runtime_duration,omitempty"` // in second
TotalDuration int64 `json:"total_duration" bson:"total_duration,omitempty"` // in second
AverageWaitDuration int64 `json:"average_wait_duration" bson:"-"` // in second
AverageRuntimeDuration int64 `json:"average_runtime_duration" bson:"-"` // in second
AverageTotalDuration int64 `json:"average_total_duration" bson:"-"` // in second
}
func (*SpiderStat) GetId ¶
func (s *SpiderStat) GetId() (id primitive.ObjectID)
func (*SpiderStat) SetId ¶
func (s *SpiderStat) SetId(id primitive.ObjectID)
type SpiderStatList ¶
type SpiderStatList []SpiderStat
func (*SpiderStatList) GetModels ¶
func (l *SpiderStatList) GetModels() (res []interfaces.Model)
type Tag ¶
type TagList ¶
type TagList []Tag
func (*TagList) GetModels ¶
func (l *TagList) GetModels() (res []interfaces.Model)
type Task ¶
type Task struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
SpiderId primitive.ObjectID `json:"spider_id" bson:"spider_id"`
Status string `json:"status" bson:"status"`
NodeId primitive.ObjectID `json:"node_id" bson:"node_id"`
Cmd string `json:"cmd" bson:"cmd"`
Param string `json:"param" bson:"param"`
Error string `json:"error" bson:"error"`
Pid int `json:"pid" bson:"pid"`
ScheduleId primitive.ObjectID `json:"schedule_id" bson:"schedule_id"` // Schedule.Id
Type string `json:"type" bson:"type"`
Mode string `json:"mode" bson:"mode"` // running mode of Task
NodeIds []primitive.ObjectID `json:"node_ids" bson:"node_ids"` // list of Node.Id
ParentId primitive.ObjectID `json:"parent_id" bson:"parent_id"` // parent Task.Id if it'Spider a sub-task
Priority int `json:"priority" bson:"priority"`
Stat *TaskStat `json:"stat,omitempty" bson:"-"`
HasSub bool `json:"has_sub" json:"has_sub"` // whether to have sub-tasks
SubTasks []Task `json:"sub_tasks,omitempty" bson:"-"`
UserId primitive.ObjectID `json:"-" bson:"-"`
}
func (*Task) GetNodeIds ¶
func (*Task) GetPriority ¶
func (*Task) GetSpiderId ¶
type TaskDailyItem ¶
type TaskList ¶
type TaskList []Task
func (*TaskList) GetModels ¶
func (l *TaskList) GetModels() (res []interfaces.Model)
type TaskQueueItem ¶
type TaskQueueItem struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Priority int `json:"p" bson:"p"`
}
func (*TaskQueueItem) GetId ¶
func (t *TaskQueueItem) GetId() (id primitive.ObjectID)
func (*TaskQueueItem) SetId ¶
func (t *TaskQueueItem) SetId(id primitive.ObjectID)
type TaskQueueItemList ¶
type TaskQueueItemList []TaskQueueItem
func (*TaskQueueItemList) GetModels ¶
func (l *TaskQueueItemList) GetModels() (res []interfaces.Model)
type TaskStat ¶
type TaskStat struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
CreateTs time.Time `json:"create_ts" bson:"create_ts,omitempty"`
StartTs time.Time `json:"start_ts" bson:"start_ts,omitempty"`
EndTs time.Time `json:"end_ts" bson:"end_ts,omitempty"`
WaitDuration int64 `json:"wait_duration" bson:"wait_duration,omitempty"` // in millisecond
RuntimeDuration int64 `json:"runtime_duration" bson:"runtime_duration,omitempty"` // in millisecond
TotalDuration int64 `json:"total_duration" bson:"total_duration,omitempty"` // in millisecond
ResultCount int64 `json:"result_count" bson:"result_count"`
ErrorLogCount int64 `json:"error_log_count" bson:"error_log_count"`
}
func (*TaskStat) GetCreateTs ¶
func (*TaskStat) GetErrorLogCount ¶
func (*TaskStat) GetResultCount ¶
func (*TaskStat) GetRuntimeDuration ¶
func (*TaskStat) GetStartTs ¶
func (*TaskStat) GetTotalDuration ¶
func (*TaskStat) GetWaitDuration ¶
func (*TaskStat) SetCreateTs ¶
func (*TaskStat) SetErrorLogCount ¶
func (*TaskStat) SetResultCount ¶
func (*TaskStat) SetRuntimeDuration ¶
func (*TaskStat) SetStartTs ¶
func (*TaskStat) SetTotalDuration ¶
func (*TaskStat) SetWaitDuration ¶
type TaskStatList ¶
type TaskStatList []TaskStat
func (*TaskStatList) GetModels ¶
func (l *TaskStatList) GetModels() (res []interfaces.Model)
type Token ¶
type TokenList ¶
type TokenList []Token
func (*TokenList) GetModels ¶
func (l *TokenList) GetModels() (res []interfaces.Model)
type User ¶
type User struct {
Id primitive.ObjectID `json:"_id" bson:"_id"`
Username string `json:"username" bson:"username"`
Password string `json:"password,omitempty" bson:"-"`
Role string `json:"role" bson:"role"`
Email string `json:"email" bson:"email"`
}
func (*User) GetPassword ¶
func (*User) GetUsername ¶
type UserList ¶
type UserList []User
func (*UserList) GetModels ¶
func (l *UserList) GetModels() (res []interfaces.Model)
type Variable ¶
type VariableList ¶
type VariableList []Variable
func (*VariableList) GetModels ¶
func (l *VariableList) GetModels() (res []interfaces.Model)
Source Files
¶
- artifact.go
- artifact_sys.go
- base.go
- data_collection.go
- data_field.go
- data_source.go
- extra_value.go
- git.go
- job.go
- map.go
- node.go
- password.go
- plugin.go
- plugin_status.go
- project.go
- result.go
- schedule.go
- setting.go
- spider.go
- spider_stat.go
- tag.go
- task.go
- task_queue_item.go
- task_stat.go
- token.go
- user.go
- utils_binder_legacy.go
- utils_col.go
- utils_model_map.go
- utils_tag.go
- variable.go
Click to show internal directories.
Click to hide internal directories.