/
types.go
84 lines (73 loc) · 2.46 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package catalog
import (
imagev1 "github.com/openshift/api/image/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ComponentType is the main struct for catalog components
type ComponentType struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentSpec `json:"spec,omitempty"`
}
// Registry is the main struct of devfile registry
type Registry struct {
Name string
URL string
}
// DevfileComponentType is the main struct for devfile catalog components
type DevfileComponentType struct {
Name string
DisplayName string
Description string
Link string
Registry Registry
}
// DevfileIndexEntry is the main struct of index.json from devfile registry
type DevfileIndexEntry struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Supported bool `json:"supported"`
Tags []string `json:"tags"`
Icon string `json:"icon"`
GlobalMemoryLimit string `json:"globalMemoryLimit"`
Registry Registry `json:"registry"`
Links struct {
Link string `json:"self"`
} `json:"links"`
}
// ComponentSpec is the spec for ComponentType
type ComponentSpec struct {
AllTags []string `json:"allTags"`
NonHiddenTags []string `json:"nonHiddenTags"`
SupportedTags []string `json:"supportedTags"`
ImageStreamTags []imagev1.TagReference `json:"imageStreamTags"`
}
// ComponentTypeList lists all the ComponentType's
type ComponentTypeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComponentType `json:"items"`
}
// DevfileComponentTypeList lists all the DevfileComponentType's
type DevfileComponentTypeList struct {
DevfileRegistries map[string]Registry
Items []DevfileComponentType
}
// ServiceType is the main struct for catalog services
type ServiceType struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ServiceSpec `json:"spec,omitempty"`
}
// ServiceSpec is the spec for ServiceType
type ServiceSpec struct {
Hidden bool `json:"hidden"`
PlanList []string `json:"planList"`
}
// ServiceTypeList lists all the ServiceType's
type ServiceTypeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServiceType `json:"items"`
}