-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
51 lines (44 loc) · 2.16 KB
/
types.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
package v1
var (
jobspecVersion = 1
)
type Jobspec struct {
Version int `json:"version" yaml:"version"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Resources Resources `json:"resources,omitempty" yaml:"resources,omitempty"`
Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"`
Groups Groups `json:"groups,omitempty" yaml:"groups,omitempty"`
Requires map[string]string `json:"requires,omitempty" yaml:"requires,omitempty"`
}
type Environment map[string]string
type Resources map[string]Resource
type Tasks []Task
type Groups []Group
type Task struct {
Group string `json:"group,omitempty" yaml:"group,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Replicas int `json:"replicas,omitempty" yaml:"replicas,omitempty"`
Resources string `json:"resources,omitempty" yaml:"resources,omitempty"`
Command []string `json:"command,omitempty" yaml:"command,omitempty"`
Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty"`
}
type Group struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Resources string `json:"resources,omitempty" yaml:"resources,omitempty"`
Tasks Tasks `json:"tasks,omitempty" yaml:"tasks,omitempty"`
Attributes Attributes `json:"attributes,omitempty" yaml:"attributes,omitempty"`
}
type Resource struct {
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Unit string `yaml:"unit,omitempty" json:"unit,omitempty"`
Count int32 `yaml:"count,omitempty" json:"count,omitempty"`
With []Resource `yaml:"with,omitempty" json:"with,omitempty"`
Label string `yaml:"label,omitempty" json:"label,omitempty"`
Exclusive bool `yaml:"exclusive,omitempty" json:"exclusive,omitempty"`
Schedule bool `yaml:"schedule,omitempty" json:"schedule,omitempty"`
}
type Attributes struct {
Duration string `yaml:"duration,omitempty" json:"duration,omitempty"`
Cwd string `yaml:"cwd,omitempty" json:"cwd,omitempty"`
Environment Environment `yaml:"environment,omitempty" json:"environment,omitempty"`
}