/
task_info.go
39 lines (34 loc) · 1022 Bytes
/
task_info.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package models
import (
"encoding/json"
"time"
"github.com/google/uuid"
)
// Shared by DAO and queue packages
// GORM only used in DAO to read from table
type TaskInfo struct {
Id uuid.UUID `gorm:"primary_key;column:id"`
Typename string `gorm:"column:type"` // "introspect" or "snapshot"
Payload json.RawMessage `gorm:"type:jsonb"`
OrgId string
AccountId string
RepositoryUUID uuid.UUID
Dependencies []uuid.UUID `gorm:"-"`
Token uuid.UUID
Queued *time.Time `gorm:"column:queued_at"`
Started *time.Time `gorm:"column:started_at"`
Finished *time.Time `gorm:"column:finished_at"`
Error *string
Status string
RequestID string
Retries int
NextRetryTime *time.Time
}
type TaskInfoRepositoryConfiguration struct {
*TaskInfo
RepositoryConfigUUID string `gorm:"column:rc_uuid"`
RepositoryConfigName string `gorm:"column:rc_name"`
}
func (*TaskInfo) TableName() string {
return "tasks"
}