-
Notifications
You must be signed in to change notification settings - Fork 43
/
application.go
55 lines (48 loc) · 2.31 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
package models
import (
"time"
specV1 "github.com/baetyl/baetyl-go/v2/spec/v1"
)
type ApplicationView struct {
Name string `json:"name,omitempty" validate:"resourceName,nonBaetyl"`
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"`
Services []specV1.Service `json:"services,omitempty"`
Volumes []VolumeView `json:"volumes,omitempty"`
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"`
Type string `json:"type,omitempty" default:"container"`
Labels map[string]string `json:"labels,omitempty"`
Selector string `json:"selector"`
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 *ListOptions `json:"listOptions"`
Items []AppItem `json:"items"`
}
type ServiceFunction struct {
Functions []specV1.ServiceFunction `json:"functions,omitempty"`
}