/
manifest.go
163 lines (135 loc) · 3.73 KB
/
manifest.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
//
// Last.Backend LLC CONFIDENTIAL
// __________________
//
// [2014] - [2018] Last.Backend LLC
// All Rights Reserved.
//
// NOTICE: All information contained herein is, and remains
// the property of Last.Backend LLC and its suppliers,
// if any. The intellectual and technical concepts contained
// herein are proprietary to Last.Backend LLC
// and its suppliers and may be covered by Russian Federation and Foreign Patents,
// patents in process, and are protected by trade secret or copyright law.
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from Last.Backend LLC.
//
package types
type NodeManifest struct {
Meta NodeManifestMeta `json:"meta"`
Resolvers map[string]*ResolverManifest `json:"resolvers"`
Secrets map[string]*SecretManifest `json:"secrets"`
Configs map[string]*ConfigManifest `json:"configs"`
Endpoints map[string]*EndpointManifest `json:"endpoint"`
Network map[string]*SubnetManifest `json:"network"`
Pods map[string]*PodManifest `json:"pods"`
Volumes map[string]*VolumeManifest `json:"volumes"`
}
type NodeManifestMeta struct {
Initial bool `json:"initial"`
}
type ResolverManifest struct {
IP string `json:"ip"`
Port uint16 `json:"port"`
}
type IngressManifest struct {
Meta IngressManifestMeta `json:"meta"`
Resolvers map[string]*ResolverManifest `json:"resolvers"`
Routes map[string]*RouteManifest `json:"routes"`
Endpoints map[string]*EndpointManifest `json:"endpoints"`
Network map[string]*SubnetManifest `json:"network"`
}
type IngressManifestMeta struct {
Initial bool `json:"initial"`
}
type DiscoveryManifest struct {
Meta DiscoveryManifestMeta `json:"meta"`
Network map[string]*SubnetManifest `json:"network"`
}
type DiscoveryManifestMeta struct {
Initial bool `json:"initial"`
}
type PodManifest PodSpec
type PodManifestList struct {
Runtime
Items []*PodManifest
}
type PodManifestMap struct {
Runtime
Items map[string]*PodManifest
}
type VolumeManifest VolumeSpec
type VolumeManifestList struct {
Runtime
Items []*VolumeManifest
}
type VolumeManifestMap struct {
Runtime
Items map[string]*VolumeManifest
}
type SubnetManifest struct {
Runtime
SubnetSpec
}
type SubnetManifestList struct {
Runtime
Items []*SubnetManifest
}
type SubnetManifestMap struct {
Runtime
Items map[string]*SubnetManifest
}
type EndpointManifest struct {
Runtime
EndpointSpec `json:",inline"`
Upstreams []string `json:"upstreams"`
}
type EndpointManifestList struct {
Runtime
Items []*EndpointManifest
}
type EndpointManifestMap struct {
Runtime
Items map[string]*EndpointManifest
}
func NewPodManifestList() *PodManifestList {
dm := new(PodManifestList)
dm.Items = make([]*PodManifest, 0)
return dm
}
func NewPodManifestMap() *PodManifestMap {
dm := new(PodManifestMap)
dm.Items = make(map[string]*PodManifest)
return dm
}
func NewVolumeManifestList() *VolumeManifestList {
dm := new(VolumeManifestList)
dm.Items = make([]*VolumeManifest, 0)
return dm
}
func NewVolumeManifestMap() *VolumeManifestMap {
dm := new(VolumeManifestMap)
dm.Items = make(map[string]*VolumeManifest)
return dm
}
func NewSubnetManifestList() *SubnetManifestList {
dm := new(SubnetManifestList)
dm.Items = make([]*SubnetManifest, 0)
return dm
}
func NewSubnetManifestMap() *SubnetManifestMap {
dm := new(SubnetManifestMap)
dm.Items = make(map[string]*SubnetManifest)
return dm
}
func NewEndpointManifestList() *EndpointManifestList {
dm := new(EndpointManifestList)
dm.Items = make([]*EndpointManifest, 0)
return dm
}
func NewEndpointManifestMap() *EndpointManifestMap {
dm := new(EndpointManifestMap)
dm.Items = make(map[string]*EndpointManifest)
return dm
}