-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
76 lines (64 loc) · 1.71 KB
/
models.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.24.0
package dbsqlc
import (
"database/sql/driver"
"fmt"
"github.com/jackc/pgx/v5/pgtype"
)
type TaskStatus string
const (
TaskStatusQUEUED TaskStatus = "QUEUED"
TaskStatusRUNNING TaskStatus = "RUNNING"
TaskStatusSUCCEEDED TaskStatus = "SUCCEEDED"
TaskStatusFAILED TaskStatus = "FAILED"
TaskStatusCANCELLED TaskStatus = "CANCELLED"
)
func (e *TaskStatus) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = TaskStatus(s)
case string:
*e = TaskStatus(s)
default:
return fmt.Errorf("unsupported scan type for TaskStatus: %T", src)
}
return nil
}
type NullTaskStatus struct {
TaskStatus TaskStatus `json:"TaskStatus"`
Valid bool `json:"valid"` // Valid is true if TaskStatus is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullTaskStatus) Scan(value interface{}) error {
if value == nil {
ns.TaskStatus, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.TaskStatus.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullTaskStatus) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.TaskStatus), nil
}
type Task struct {
ID int64 `json:"id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
Status TaskStatus `json:"status"`
Args []byte `json:"args"`
GroupKey pgtype.Text `json:"group_key"`
}
type TaskAddrPtr struct {
MaxAssignedBlockAddr int64 `json:"max_assigned_block_addr"`
OnerowID bool `json:"onerow_id"`
}
type TaskGroup struct {
ID int64 `json:"id"`
GroupKey pgtype.Text `json:"group_key"`
BlockAddr pgtype.Int8 `json:"block_addr"`
}