Spaces:
Sleeping
Sleeping
| package models | |
| import "time" | |
| type TaskType string | |
| const ( | |
| TaskTypeDownload TaskType = "download" | |
| TaskTypeExtract TaskType = "extract" | |
| ) | |
| type TaskStatus string | |
| const ( | |
| TaskStatusQueued TaskStatus = "queued" | |
| TaskStatusRunning TaskStatus = "running" | |
| TaskStatusSuccess TaskStatus = "success" | |
| TaskStatusFailed TaskStatus = "failed" | |
| ) | |
| type Task struct { | |
| ID uint `json:"id" gorm:"primaryKey"` | |
| Type TaskType `json:"type"` | |
| Status TaskStatus `json:"status"` | |
| Source string `json:"source"` | |
| TargetPath string `json:"targetPath"` | |
| Progress int `json:"progress"` | |
| Logs string `json:"logs" gorm:"type:text"` | |
| Error string `json:"error"` | |
| CreatedAt time.Time `json:"createdAt"` | |
| UpdatedAt time.Time `json:"updatedAt"` | |
| } | |