-
Notifications
You must be signed in to change notification settings - Fork 311
/
model.go
54 lines (46 loc) · 1.26 KB
/
model.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
package model
import (
"errors"
"time"
)
var (
ErrDestTypeNotFound = errors.New("destination type not found for the destination ID")
ErrDestDetail = errors.New("error while getting destination details")
ErrNoRunnableJob = errors.New("no runnable job found")
ErrDestNotImplemented = errors.New("job deletion not implemented for the destination")
ErrInvalidDestination = errors.New("invalid destination")
ErrRequestTimeout = errors.New("request timeout")
)
type JobStatus string
const (
JobStatusUndefined JobStatus = ""
JobStatusPending JobStatus = "pending"
JobStatusRunning JobStatus = "running"
JobStatusComplete JobStatus = "complete"
JobStatusFailed JobStatus = "failed"
JobStatusNotSupported JobStatus = "unsupported"
JobStatusAborted JobStatus = "aborted"
)
type Job struct {
ID int
WorkspaceID string
DestinationID string
Status JobStatus
Users []User
UpdatedAt time.Time
}
type User struct {
ID string
Attributes map[string]string
}
type Destination struct {
Config map[string]interface{}
DestDefConfig map[string]interface{}
DestinationID string
Name string
}
type APIReqErr struct {
StatusCode int
Body string
Err error
}