Documentation
¶
Index ¶
- Constants
- Variables
- type Task
- func (t *Task) All(tx *gorm.DB) (task []Task)
- func (t *Task) CountUnload(tx *gorm.DB) (count int64)
- func (t *Task) GetUnFinished(tx *gorm.DB) (lines []Task, err error)
- func (t *Task) Load(tx *gorm.DB) error
- func (t *Task) Loaded2Unload(tx *gorm.DB) error
- func (t *Task) SetLineFinished(tx *gorm.DB, updates map[string]interface{}) error
- func (t Task) TableName() string
- func (t *Task) Write(tx *gorm.DB) error
Constants ¶
View Source
const ( Unload = "unload" Loaded = "loaded" Finish = "finish" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct {
ID int `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at"` // 创建时间
UpdatedAt time.Time `json:"updated_at"` // 更新时间
UniqueKey string `gorm:"uniqueIndex" json:"unique_key"` // 唯一键
Url string `json:"url"` // 请求链接
Params string `json:"params"` // 请求参数
ParserFunction string `json:"parser_function"` // 解析方法
FailedReason string `json:"failed_reason"` // 失败原因
Status string `json:"status"` // 任务状态
Title string `json:"title"` // 任务标题
Content string `json:"content"` // 数据主体
Remark string `json:"remark"` // 备注
}
func (*Task) SetLineFinished ¶
Source Files
¶
- task.go
Click to show internal directories.
Click to hide internal directories.