This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
/
resources.go
360 lines (315 loc) · 9.23 KB
/
resources.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
// Code generated by "esc -pkg qgraph -prefix -ignore -include -o resources.go manifests"; DO NOT EDIT.
package qgraph
import (
"bytes"
"compress/gzip"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"sync"
"time"
)
type _escLocalFS struct{}
var _escLocal _escLocalFS
type _escStaticFS struct{}
var _escStatic _escStaticFS
type _escDirectory struct {
fs http.FileSystem
name string
}
type _escFile struct {
compressed string
size int64
modtime int64
local string
isDir bool
once sync.Once
data []byte
name string
}
func (_escLocalFS) Open(name string) (http.File, error) {
f, present := _escData[path.Clean(name)]
if !present {
return nil, os.ErrNotExist
}
return os.Open(f.local)
}
func (_escStaticFS) prepare(name string) (*_escFile, error) {
f, present := _escData[path.Clean(name)]
if !present {
return nil, os.ErrNotExist
}
var err error
f.once.Do(func() {
f.name = path.Base(name)
if f.size == 0 {
return
}
var gr *gzip.Reader
b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed))
gr, err = gzip.NewReader(b64)
if err != nil {
return
}
f.data, err = ioutil.ReadAll(gr)
})
if err != nil {
return nil, err
}
return f, nil
}
func (fs _escStaticFS) Open(name string) (http.File, error) {
f, err := fs.prepare(name)
if err != nil {
return nil, err
}
return f.File()
}
func (dir _escDirectory) Open(name string) (http.File, error) {
return dir.fs.Open(dir.name + name)
}
func (f *_escFile) File() (http.File, error) {
type httpFile struct {
*bytes.Reader
*_escFile
}
return &httpFile{
Reader: bytes.NewReader(f.data),
_escFile: f,
}, nil
}
func (f *_escFile) Close() error {
return nil
}
func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) {
if !f.isDir {
return nil, fmt.Errorf(" escFile.Readdir: '%s' is not directory", f.name)
}
fis, ok := _escDirs[f.local]
if !ok {
return nil, fmt.Errorf(" escFile.Readdir: '%s' is directory, but we have no info about content of this dir, local=%s", f.name, f.local)
}
limit := count
if count <= 0 || limit > len(fis) {
limit = len(fis)
}
if len(fis) == 0 && count > 0 {
return nil, io.EOF
}
return []os.FileInfo(fis[0:limit]), nil
}
func (f *_escFile) Stat() (os.FileInfo, error) {
return f, nil
}
func (f *_escFile) Name() string {
return f.name
}
func (f *_escFile) Size() int64 {
return f.size
}
func (f *_escFile) Mode() os.FileMode {
return 0
}
func (f *_escFile) ModTime() time.Time {
return time.Unix(f.modtime, 0)
}
func (f *_escFile) IsDir() bool {
return f.isDir
}
func (f *_escFile) Sys() interface{} {
return f
}
// FS returns a http.Filesystem for the embedded assets. If useLocal is true,
// the filesystem's contents are instead used.
func FS(useLocal bool) http.FileSystem {
if useLocal {
return _escLocal
}
return _escStatic
}
// Dir returns a http.Filesystem for the embedded assets on a given prefix dir.
// If useLocal is true, the filesystem's contents are instead used.
func Dir(useLocal bool, name string) http.FileSystem {
if useLocal {
return _escDirectory{fs: _escLocal, name: name}
}
return _escDirectory{fs: _escStatic, name: name}
}
// FSByte returns the named file from the embedded assets. If useLocal is
// true, the filesystem's contents are instead used.
func FSByte(useLocal bool, name string) ([]byte, error) {
if useLocal {
f, err := _escLocal.Open(name)
if err != nil {
return nil, err
}
b, err := ioutil.ReadAll(f)
_ = f.Close()
return b, err
}
f, err := _escStatic.prepare(name)
if err != nil {
return nil, err
}
return f.data, nil
}
// FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustByte(useLocal bool, name string) []byte {
b, err := FSByte(useLocal, name)
if err != nil {
panic(err)
}
return b
}
// FSString is the string version of FSByte.
func FSString(useLocal bool, name string) (string, error) {
b, err := FSByte(useLocal, name)
return string(b), err
}
// FSMustString is the string version of FSMustByte.
func FSMustString(useLocal bool, name string) string {
return string(FSMustByte(useLocal, name))
}
var _escData = map[string]*_escFile{
"/manifests/error.yml": {
name: "error.yml",
local: "manifests/error.yml",
size: 13,
modtime: 1543299825,
compressed: `
H4sIAAAAAAAC/9JVyEvMTbVSSC0qyi8CBAAA///rGPd6DQAAAA==
`,
},
"/manifests/java.yml": {
name: "java.yml",
local: "manifests/java.yml",
size: 796,
modtime: 1543551514,
compressed: `
H4sIAAAAAAAC/8yRwW6DMAyG7zyFlQun9gEiVTvuEaadkBXMli4kzHZa8fYTNBTRdpN26xV+f/7yewcR
e7JwxBNWAN+ZRH2KYisAgB2ckJtLwnSMPZ0Tf5n5H0BL4tgPU96CeftEhWsGxpQBmSCLjx8vy4jD2PoW
lcqCZUnIZEFT71Cv328XvKfMMHA6ktMVXab25p539qHtwvhfYBmbgMoYxW8KWetqNr4uxdYX8NrC4QD1
JVabe8BW8HdCydWmqh4L/Hk2HzE0yOo7dLrUNBCLF6WoFpQzPTzpayaR6ZIMMwUWCnixZtUWxahNad1I
jyEUt/3Yh1vr9dVPqF3kZu+fAAAA//8dwwm2HAMAAA==
`,
},
"/manifests/jenkins.yml": {
name: "jenkins.yml",
local: "manifests/jenkins.yml",
size: 509,
modtime: 1543687698,
compressed: `
H4sIAAAAAAAC/3SQy2ozMQyF9/MUB2+ySh7AkNX/Qx/DCI9C3XrkqSUX5u3L3AimjdbnovNdITSxxwfL
ZxIdgK/GaqmI+gEArvimGnaRO1Rh5DmXZWKxYMvMblMCI2usaV7dHu7feynKWEqreBqwGvzpiCRjGsn4
aDsbc2MPnSjn8PzsvL7m/xYN2uWIualxRXmcm25rmVUSTd2ufdNfJbHImI74F5Nxv+PSeS9uGF6Fdkw7
oo8klANVSw+KtmOZuWpSYzEPq42H36PfGqvuaLcEnAlIesCNRdRILBw0XffUbZmy+wkAAP//U+4u1/0B
AAA=
`,
},
"/manifests/jmeter.yml": {
name: "jmeter.yml",
local: "manifests/jmeter.yml",
size: 500,
modtime: 1543551514,
compressed: `
H4sIAAAAAAAC/3SQTWrDMBCF9z7FQ5uskgMIsmqhxxCDPKYqsuRqRgXfvtiS25ims34/874rEs1s8TGz
chmAz8qiISexAwBc8UXFNY1pIjfyEvM6c1Kn68JmFwIjiy9h2cwW5uU9Z2GsuRb8GrAZ7OHwlMYwknIv
OwpjZQuZKUb389dx55bXPRnU1PCxinJBnvqg21alhZKE06g26EmFz2kMPfz5XNzvuDw6L2YY/kk8wTyh
nEKi6KhomMhrA7JwkSDKSS20VB7+7n2rLNKg7gk4EhCkY/U5iVJS1zmax59u6xzNdwAAAP//9mwI7PQB
AAA=
`,
},
"/manifests/kubernetes.yml": {
name: "kubernetes.yml",
local: "manifests/kubernetes.yml",
size: 561,
modtime: 1543551514,
compressed: `
H4sIAAAAAAAC/4SRS27zMAyE9z7FQJuskgMIyOr/gR5DYC2mFSpTrkgV8O0Lv5AYfWnNmU8zc4bQwB5v
7ZmrsLF2wHtjtVREfQcAZ3xQDeudux+GyGMu08BiwaaR3XIMRNa+pnE28HD/XktRxlRaxV2AWeB3RU8S
UyTjDbhDc2MPTfKSOUiJHA6/3N+R939hgDadFcEsRbk9ZLzMZKskmg4514y/EvsiMW2sn7vA9YrT9z4n
13V/kg4LHPq/JaEcqFq6UW9rgyNXTWos5mG1cfe1lqfGqusKiwN2ByTdduiLqJFY2Ip3OlDOD/+6TEN2
nwEAAP//zZXusjECAAA=
`,
},
"/manifests/load_test.yml": {
name: "load_test.yml",
local: "manifests/load_test.yml",
size: 411,
modtime: 1543467504,
compressed: `
H4sIAAAAAAAC/6TQsU7EMBAE0D5fMbom1V16/wiltcR7iiHxmvUaC74eGSsnIURFa814n+aKRAc77ELB
GxebgLfKxaKk4iYAuOKd1I/Yy8HG6h9pzylkicn8WUoUlb97QGYtsRgnczCt53PgsmrMPe1wedrI5oIP
qYrzN5jgmdEvcLg8anequznMm1l2y9Jau9FnVb6tcsx/WZWzqPldVtp96OZ/UFkZQToWjYYzSEt9D9g2
xBgXf7MXO3JnmlIq8cfCQ0xq8U6r+deYwvQVAAD//wUJAPabAQAA
`,
},
"/manifests/main.yml": {
name: "main.yml",
local: "manifests/main.yml",
size: 3309,
modtime: 1543687698,
compressed: `
H4sIAAAAAAAC/5xVTW/jOAy951cQ3kMuM/kBAQaDBYq99lJgsSeDtZlYtSNpRSpF/v1A8ncsu0lvrUM+
Pj0+kj9B44WO4IyRHcD/nliU0XzcAQD8hCu6vI3A8qJ0/Dv+BGDJsWIhLUcQ5/vPJXHhlA0oR8j+rVDa
1FgISgM34+ETtcDJuPCPg5JsY24X0vI7G1BO6Bs5QlY3nsllCz6NKTAUeY6NKipwdFZGz6iI6UiAmAQH
QhbPSw6O2HhXUH52xtvvidNjQMRYqPR7WRU1q/eG8sqw5DXd8qKiolb6/Eztl8nrWZwqBJgrCJhQ0w16
zEGNAnWpShTqvNGzajwdIUOus+Hzfa2/uR6bjdY6c8UGPiuKTUiWPWSJItqs13gxoI0EvDWsqYQfFxJy
eWOwzIVYctL43lD5XQURAhQEKMCTkAOpKOXrTRX3b87TfvWJbwZammMxPhxSSu3/wYa3kbhWdokjLphr
tgH6aeuU6t9hdKk6tDUx4dev7knZDAudqBMWktdKl8/itS/Ldrs1tI0VNqmX2gvhZzCnAZETc/hFB5U+
OWRxvhDvaEv/0RvRKvNE/gGNqgNj/05Ok9BKo9HaRs324EaxYf76FPhUUkFhSurr2cr+gA+84ld+SD50
2sQoZmjYPPLeCgv+SYxJ2Kz1s+x176I+ezzTmDh82bRLZp35oELybskHoXKLUmUrawL+grfXl1fAsgT2
1hrXHrnQYHFEMMgQbBa+XtGp4G0+rPiSHO05hnZXIpAI2bGXHcHEjRi4n5Xkjq6KldHZd25lm5q+lolT
eUGW1LnOes3jnGYPjGGfAOgo1vb88D2ylV2dh/8mykXsiBtShpKpUQtT8SxmyJmDrpp0ZDydgJlocRRs
Ze9maEJsOzUETsdnMcNbsxCDc7lZeqR3c+gt52y3sUGl8+vlgd1mNEHQvCG4XtrFFj6VKAil4jrV0nG7
PlAAJ+FQND7YPOmTeL0eAmxDN8FI10o/Rq+LncGt222u7NQ4Y6dbw3WRd65baLcBMcbeW3eq1QZAG3ef
PNNmK7sN3Gd/AgAA//9Bjee87QwAAA==
`,
},
"/manifests/php.yml": {
name: "php.yml",
local: "manifests/php.yml",
size: 1159,
modtime: 1543551514,
compressed: `
H4sIAAAAAAAC/8ySsU7DQAyG9z7FrwzdigrjCVh5AfbolLrU0t0l2L6Kvj1K0zRNCIhuyRbJ/+dP/m+D
5CM5NIdmBXxmUuM6qVsBwAZHL2U3UFR1qrIIJSuzkhTnCcBODTlwssv/jrQSblqKQ/F+IAxB9EETn5RH
m7otGn0IZSfTflWddnxhTQTw/ILH7bYY5SPtOMd/Al7bPNZrzJMn6ODlg+4h/4Z++oGO/ovjHdodYTV3
tL8a3HPyofRivPeV9QU2JMpqlMzBJNNsj2+ZVHGqs+BMQU8BqysGaTWfrDz6kNuFV7GHUww3wqOWFmU8
mE2Ub9tflPFVbHrj0Zta1pEHtU4a+A4AAP//QbLR9YcEAAA=
`,
},
"/manifests/plain_vm.yml": {
name: "plain_vm.yml",
local: "manifests/plain_vm.yml",
size: 165,
modtime: 1543551514,
compressed: `
H4sIAAAAAAAC/zTOwanEMAwE0HuqGHzPL8AN/DKMyCogcGSvJBvS/ZKEXIfhzaxQOjijVxIt81iA72AP
aep5AVZMsvJ00i5KtZCF7LRFWgCgs7l4sEZG2OA7/LBvJv1SMtL/YHecbRhuAa8A8fwoW1MP0iiT6rim
3j9/51HTLwAA//92kVu5pQAAAA==
`,
},
"/manifests": {
name: "manifests",
local: `manifests`,
isDir: true,
},
}
var _escDirs = map[string][]os.FileInfo{
"manifests": {
_escData["/manifests/error.yml"],
_escData["/manifests/java.yml"],
_escData["/manifests/jenkins.yml"],
_escData["/manifests/jmeter.yml"],
_escData["/manifests/kubernetes.yml"],
_escData["/manifests/load_test.yml"],
_escData["/manifests/main.yml"],
_escData["/manifests/php.yml"],
_escData["/manifests/plain_vm.yml"],
},
}