-
Notifications
You must be signed in to change notification settings - Fork 43
/
application.go
64 lines (56 loc) · 2.7 KB
/
application.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
package models
import (
"time"
specV1 "github.com/baetyl/baetyl-go/v2/spec/v1"
)
type ApplicationView struct {
Name string `json:"name,omitempty" validate:"resourceName"`
Mode string `json:"mode,omitempty" default:"kube"`
Type string `json:"type,omitempty" default:"container"`
Labels map[string]string `json:"labels,omitempty"`
Namespace string `json:"namespace,omitempty"`
CreationTimestamp time.Time `json:"createTime,omitempty"`
Version string `json:"version,omitempty"`
Selector string `json:"selector,omitempty"`
NodeSelector string `json:"nodeSelector,omitempty"`
Services []ServiceView `json:"services,omitempty" validate:"dive"`
Volumes []VolumeView `json:"volumes,omitempty" validate:"dive"`
Description string `json:"description,omitempty"`
System bool `json:"system,omitempty"`
Registries []RegistryView `json:"registries,omitempty"`
}
// VolumeView volume view
type VolumeView struct {
// specified name of the volume
Name string `json:"name,omitempty" binding:"required" validate:"omitempty,resourceName"`
HostPath *specV1.HostPathVolumeSource `json:"hostPath,omitempty"`
Config *specV1.ObjectReference `json:"config,omitempty"`
Secret *specV1.ObjectReference `json:"secret,omitempty"`
Certificate *specV1.ObjectReference `json:"certificate,omitempty"`
}
type AppItem struct {
Name string `json:"name,omitempty" validate:"omitempty,resourceName"`
Mode string `json:"mode,omitempty" default:"kube"`
Type string `json:"type,omitempty" default:"container"`
Labels map[string]string `json:"labels,omitempty"`
Selector string `json:"selector"`
NodeSelector string `json:"nodeSelector"`
Version string `json:"version,omitempty"`
Namespace string `json:"namespace,omitempty"`
CreationTimestamp time.Time `json:"createTime,omitempty"`
Description string `json:"description,omitempty"`
System bool `json:"system,omitempty"`
}
// ApplicationList app List
type ApplicationList struct {
Total int `json:"total"`
*ListOptions `json:",inline"`
Items []AppItem `json:"items"`
}
type ServiceFunction struct {
Functions []specV1.ServiceFunction `json:"functions,omitempty"`
}
type ServiceView struct {
specV1.Service `json:",inline"`
ProgramConfig string `json:"programConfig,omitempty"`
}