/
v2_worker.go
30 lines (27 loc) · 1.47 KB
/
v2_worker.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
package sdk
import (
"time"
)
// V2Worker represents instances of CDS workers living to serve.
type V2Worker struct {
ID string `json:"id" cli:"-" db:"id"`
Name string `json:"name" cli:"name,key" db:"name"`
LastBeat time.Time `json:"last_beat" cli:"last_beat" db:"last_beat"`
ModelName string `json:"model_name" cli:"-" db:"model_name"`
JobRunID string `json:"run_job_id" cli:"-" db:"run_job_id"`
Status string `json:"status" cli:"status" db:"status"` // Waiting, Building, Disabled, Unknown
HatcheryID string `json:"hatchery_id,omitempty" cli:"-" db:"hatchery_id"`
HatcheryName string `json:"hatchery_name" cli:"-" db:"hatchery_name"` // If the hatchery service was deleted we will keep its name in the worker
ConsumerID string `json:"-" cli:"-" db:"auth_consumer_id"`
Version string `json:"version" cli:"version" db:"version"`
OS string `json:"os" cli:"os" db:"os"`
Arch string `json:"arch" cli:"arch" db:"arch"`
PrivateKey []byte `json:"cypher_private_key,omitempty" cli:"-" db:"cypher_private_key" gorpmapping:"encrypted,ID,JobRunID,HatcheryID,ConsumerID"`
}
type V2TakeJobResponse struct {
RunJob V2WorkflowRunJob `json:"run_job"`
AsCodeActions map[string]V2Action `json:"actions"`
SigningKey string `json:"signing_key"`
Contexts WorkflowRunJobsContext `json:"contexts"`
SensitiveDatas []string `json:"sensitive_datas"`
}