talos

Форк
0
/
outputkind_enumer.go 
396 строк · 12.1 Кб
1
// Code generated by "enumer -type OutputKind,OutFormat,DiskFormat,SDBootEnrollKeys -linecomment -text"; DO NOT EDIT.
2

3
package profile
4

5
import (
6
	"fmt"
7
	"strings"
8
)
9

10
const _OutputKindName = "unknownisoimageinstallerkernelinitramfsukicmdline"
11

12
var _OutputKindIndex = [...]uint8{0, 7, 10, 15, 24, 30, 39, 42, 49}
13

14
const _OutputKindLowerName = "unknownisoimageinstallerkernelinitramfsukicmdline"
15

16
func (i OutputKind) String() string {
17
	if i < 0 || i >= OutputKind(len(_OutputKindIndex)-1) {
18
		return fmt.Sprintf("OutputKind(%d)", i)
19
	}
20
	return _OutputKindName[_OutputKindIndex[i]:_OutputKindIndex[i+1]]
21
}
22

23
// An "invalid array index" compiler error signifies that the constant values have changed.
24
// Re-run the stringer command to generate them again.
25
func _OutputKindNoOp() {
26
	var x [1]struct{}
27
	_ = x[OutKindUnknown-(0)]
28
	_ = x[OutKindISO-(1)]
29
	_ = x[OutKindImage-(2)]
30
	_ = x[OutKindInstaller-(3)]
31
	_ = x[OutKindKernel-(4)]
32
	_ = x[OutKindInitramfs-(5)]
33
	_ = x[OutKindUKI-(6)]
34
	_ = x[OutKindCmdline-(7)]
35
}
36

37
var _OutputKindValues = []OutputKind{OutKindUnknown, OutKindISO, OutKindImage, OutKindInstaller, OutKindKernel, OutKindInitramfs, OutKindUKI, OutKindCmdline}
38

39
var _OutputKindNameToValueMap = map[string]OutputKind{
40
	_OutputKindName[0:7]:        OutKindUnknown,
41
	_OutputKindLowerName[0:7]:   OutKindUnknown,
42
	_OutputKindName[7:10]:       OutKindISO,
43
	_OutputKindLowerName[7:10]:  OutKindISO,
44
	_OutputKindName[10:15]:      OutKindImage,
45
	_OutputKindLowerName[10:15]: OutKindImage,
46
	_OutputKindName[15:24]:      OutKindInstaller,
47
	_OutputKindLowerName[15:24]: OutKindInstaller,
48
	_OutputKindName[24:30]:      OutKindKernel,
49
	_OutputKindLowerName[24:30]: OutKindKernel,
50
	_OutputKindName[30:39]:      OutKindInitramfs,
51
	_OutputKindLowerName[30:39]: OutKindInitramfs,
52
	_OutputKindName[39:42]:      OutKindUKI,
53
	_OutputKindLowerName[39:42]: OutKindUKI,
54
	_OutputKindName[42:49]:      OutKindCmdline,
55
	_OutputKindLowerName[42:49]: OutKindCmdline,
56
}
57

58
var _OutputKindNames = []string{
59
	_OutputKindName[0:7],
60
	_OutputKindName[7:10],
61
	_OutputKindName[10:15],
62
	_OutputKindName[15:24],
63
	_OutputKindName[24:30],
64
	_OutputKindName[30:39],
65
	_OutputKindName[39:42],
66
	_OutputKindName[42:49],
67
}
68

69
// OutputKindString retrieves an enum value from the enum constants string name.
70
// Throws an error if the param is not part of the enum.
71
func OutputKindString(s string) (OutputKind, error) {
72
	if val, ok := _OutputKindNameToValueMap[s]; ok {
73
		return val, nil
74
	}
75

76
	if val, ok := _OutputKindNameToValueMap[strings.ToLower(s)]; ok {
77
		return val, nil
78
	}
79
	return 0, fmt.Errorf("%s does not belong to OutputKind values", s)
80
}
81

82
// OutputKindValues returns all values of the enum
83
func OutputKindValues() []OutputKind {
84
	return _OutputKindValues
85
}
86

87
// OutputKindStrings returns a slice of all String values of the enum
88
func OutputKindStrings() []string {
89
	strs := make([]string, len(_OutputKindNames))
90
	copy(strs, _OutputKindNames)
91
	return strs
92
}
93

94
// IsAOutputKind returns "true" if the value is listed in the enum definition. "false" otherwise
95
func (i OutputKind) IsAOutputKind() bool {
96
	for _, v := range _OutputKindValues {
97
		if i == v {
98
			return true
99
		}
100
	}
101
	return false
102
}
103

104
// MarshalText implements the encoding.TextMarshaler interface for OutputKind
105
func (i OutputKind) MarshalText() ([]byte, error) {
106
	return []byte(i.String()), nil
107
}
108

109
// UnmarshalText implements the encoding.TextUnmarshaler interface for OutputKind
110
func (i *OutputKind) UnmarshalText(text []byte) error {
111
	var err error
112
	*i, err = OutputKindString(string(text))
113
	return err
114
}
115

116
const _OutFormatName = "unknownraw.tar.gz.xz.gz.zst"
117

118
var _OutFormatIndex = [...]uint8{0, 7, 10, 17, 20, 23, 27}
119

120
const _OutFormatLowerName = "unknownraw.tar.gz.xz.gz.zst"
121

122
func (i OutFormat) String() string {
123
	if i < 0 || i >= OutFormat(len(_OutFormatIndex)-1) {
124
		return fmt.Sprintf("OutFormat(%d)", i)
125
	}
126
	return _OutFormatName[_OutFormatIndex[i]:_OutFormatIndex[i+1]]
127
}
128

129
// An "invalid array index" compiler error signifies that the constant values have changed.
130
// Re-run the stringer command to generate them again.
131
func _OutFormatNoOp() {
132
	var x [1]struct{}
133
	_ = x[OutFormatUnknown-(0)]
134
	_ = x[OutFormatRaw-(1)]
135
	_ = x[OutFormatTar-(2)]
136
	_ = x[OutFormatXZ-(3)]
137
	_ = x[OutFormatGZ-(4)]
138
	_ = x[OutFormatZSTD-(5)]
139
}
140

141
var _OutFormatValues = []OutFormat{OutFormatUnknown, OutFormatRaw, OutFormatTar, OutFormatXZ, OutFormatGZ, OutFormatZSTD}
142

143
var _OutFormatNameToValueMap = map[string]OutFormat{
144
	_OutFormatName[0:7]:        OutFormatUnknown,
145
	_OutFormatLowerName[0:7]:   OutFormatUnknown,
146
	_OutFormatName[7:10]:       OutFormatRaw,
147
	_OutFormatLowerName[7:10]:  OutFormatRaw,
148
	_OutFormatName[10:17]:      OutFormatTar,
149
	_OutFormatLowerName[10:17]: OutFormatTar,
150
	_OutFormatName[17:20]:      OutFormatXZ,
151
	_OutFormatLowerName[17:20]: OutFormatXZ,
152
	_OutFormatName[20:23]:      OutFormatGZ,
153
	_OutFormatLowerName[20:23]: OutFormatGZ,
154
	_OutFormatName[23:27]:      OutFormatZSTD,
155
	_OutFormatLowerName[23:27]: OutFormatZSTD,
156
}
157

158
var _OutFormatNames = []string{
159
	_OutFormatName[0:7],
160
	_OutFormatName[7:10],
161
	_OutFormatName[10:17],
162
	_OutFormatName[17:20],
163
	_OutFormatName[20:23],
164
	_OutFormatName[23:27],
165
}
166

167
// OutFormatString retrieves an enum value from the enum constants string name.
168
// Throws an error if the param is not part of the enum.
169
func OutFormatString(s string) (OutFormat, error) {
170
	if val, ok := _OutFormatNameToValueMap[s]; ok {
171
		return val, nil
172
	}
173

174
	if val, ok := _OutFormatNameToValueMap[strings.ToLower(s)]; ok {
175
		return val, nil
176
	}
177
	return 0, fmt.Errorf("%s does not belong to OutFormat values", s)
178
}
179

180
// OutFormatValues returns all values of the enum
181
func OutFormatValues() []OutFormat {
182
	return _OutFormatValues
183
}
184

185
// OutFormatStrings returns a slice of all String values of the enum
186
func OutFormatStrings() []string {
187
	strs := make([]string, len(_OutFormatNames))
188
	copy(strs, _OutFormatNames)
189
	return strs
190
}
191

192
// IsAOutFormat returns "true" if the value is listed in the enum definition. "false" otherwise
193
func (i OutFormat) IsAOutFormat() bool {
194
	for _, v := range _OutFormatValues {
195
		if i == v {
196
			return true
197
		}
198
	}
199
	return false
200
}
201

202
// MarshalText implements the encoding.TextMarshaler interface for OutFormat
203
func (i OutFormat) MarshalText() ([]byte, error) {
204
	return []byte(i.String()), nil
205
}
206

207
// UnmarshalText implements the encoding.TextUnmarshaler interface for OutFormat
208
func (i *OutFormat) UnmarshalText(text []byte) error {
209
	var err error
210
	*i, err = OutFormatString(string(text))
211
	return err
212
}
213

214
const _DiskFormatName = "unknownrawqcow2vhdova"
215

216
var _DiskFormatIndex = [...]uint8{0, 7, 10, 15, 18, 21}
217

218
const _DiskFormatLowerName = "unknownrawqcow2vhdova"
219

220
func (i DiskFormat) String() string {
221
	if i < 0 || i >= DiskFormat(len(_DiskFormatIndex)-1) {
222
		return fmt.Sprintf("DiskFormat(%d)", i)
223
	}
224
	return _DiskFormatName[_DiskFormatIndex[i]:_DiskFormatIndex[i+1]]
225
}
226

227
// An "invalid array index" compiler error signifies that the constant values have changed.
228
// Re-run the stringer command to generate them again.
229
func _DiskFormatNoOp() {
230
	var x [1]struct{}
231
	_ = x[DiskFormatUnknown-(0)]
232
	_ = x[DiskFormatRaw-(1)]
233
	_ = x[DiskFormatQCOW2-(2)]
234
	_ = x[DiskFormatVPC-(3)]
235
	_ = x[DiskFormatOVA-(4)]
236
}
237

238
var _DiskFormatValues = []DiskFormat{DiskFormatUnknown, DiskFormatRaw, DiskFormatQCOW2, DiskFormatVPC, DiskFormatOVA}
239

240
var _DiskFormatNameToValueMap = map[string]DiskFormat{
241
	_DiskFormatName[0:7]:        DiskFormatUnknown,
242
	_DiskFormatLowerName[0:7]:   DiskFormatUnknown,
243
	_DiskFormatName[7:10]:       DiskFormatRaw,
244
	_DiskFormatLowerName[7:10]:  DiskFormatRaw,
245
	_DiskFormatName[10:15]:      DiskFormatQCOW2,
246
	_DiskFormatLowerName[10:15]: DiskFormatQCOW2,
247
	_DiskFormatName[15:18]:      DiskFormatVPC,
248
	_DiskFormatLowerName[15:18]: DiskFormatVPC,
249
	_DiskFormatName[18:21]:      DiskFormatOVA,
250
	_DiskFormatLowerName[18:21]: DiskFormatOVA,
251
}
252

253
var _DiskFormatNames = []string{
254
	_DiskFormatName[0:7],
255
	_DiskFormatName[7:10],
256
	_DiskFormatName[10:15],
257
	_DiskFormatName[15:18],
258
	_DiskFormatName[18:21],
259
}
260

261
// DiskFormatString retrieves an enum value from the enum constants string name.
262
// Throws an error if the param is not part of the enum.
263
func DiskFormatString(s string) (DiskFormat, error) {
264
	if val, ok := _DiskFormatNameToValueMap[s]; ok {
265
		return val, nil
266
	}
267

268
	if val, ok := _DiskFormatNameToValueMap[strings.ToLower(s)]; ok {
269
		return val, nil
270
	}
271
	return 0, fmt.Errorf("%s does not belong to DiskFormat values", s)
272
}
273

274
// DiskFormatValues returns all values of the enum
275
func DiskFormatValues() []DiskFormat {
276
	return _DiskFormatValues
277
}
278

279
// DiskFormatStrings returns a slice of all String values of the enum
280
func DiskFormatStrings() []string {
281
	strs := make([]string, len(_DiskFormatNames))
282
	copy(strs, _DiskFormatNames)
283
	return strs
284
}
285

286
// IsADiskFormat returns "true" if the value is listed in the enum definition. "false" otherwise
287
func (i DiskFormat) IsADiskFormat() bool {
288
	for _, v := range _DiskFormatValues {
289
		if i == v {
290
			return true
291
		}
292
	}
293
	return false
294
}
295

296
// MarshalText implements the encoding.TextMarshaler interface for DiskFormat
297
func (i DiskFormat) MarshalText() ([]byte, error) {
298
	return []byte(i.String()), nil
299
}
300

301
// UnmarshalText implements the encoding.TextUnmarshaler interface for DiskFormat
302
func (i *DiskFormat) UnmarshalText(text []byte) error {
303
	var err error
304
	*i, err = DiskFormatString(string(text))
305
	return err
306
}
307

308
const _SDBootEnrollKeysName = "if-safemanualforceoff"
309

310
var _SDBootEnrollKeysIndex = [...]uint8{0, 7, 13, 18, 21}
311

312
const _SDBootEnrollKeysLowerName = "if-safemanualforceoff"
313

314
func (i SDBootEnrollKeys) String() string {
315
	if i < 0 || i >= SDBootEnrollKeys(len(_SDBootEnrollKeysIndex)-1) {
316
		return fmt.Sprintf("SDBootEnrollKeys(%d)", i)
317
	}
318
	return _SDBootEnrollKeysName[_SDBootEnrollKeysIndex[i]:_SDBootEnrollKeysIndex[i+1]]
319
}
320

321
// An "invalid array index" compiler error signifies that the constant values have changed.
322
// Re-run the stringer command to generate them again.
323
func _SDBootEnrollKeysNoOp() {
324
	var x [1]struct{}
325
	_ = x[SDBootEnrollKeysIfSafe-(0)]
326
	_ = x[SDBootEnrollKeysManual-(1)]
327
	_ = x[SDBootEnrollKeysForce-(2)]
328
	_ = x[SDBootEnrollKeysOff-(3)]
329
}
330

331
var _SDBootEnrollKeysValues = []SDBootEnrollKeys{SDBootEnrollKeysIfSafe, SDBootEnrollKeysManual, SDBootEnrollKeysForce, SDBootEnrollKeysOff}
332

333
var _SDBootEnrollKeysNameToValueMap = map[string]SDBootEnrollKeys{
334
	_SDBootEnrollKeysName[0:7]:        SDBootEnrollKeysIfSafe,
335
	_SDBootEnrollKeysLowerName[0:7]:   SDBootEnrollKeysIfSafe,
336
	_SDBootEnrollKeysName[7:13]:       SDBootEnrollKeysManual,
337
	_SDBootEnrollKeysLowerName[7:13]:  SDBootEnrollKeysManual,
338
	_SDBootEnrollKeysName[13:18]:      SDBootEnrollKeysForce,
339
	_SDBootEnrollKeysLowerName[13:18]: SDBootEnrollKeysForce,
340
	_SDBootEnrollKeysName[18:21]:      SDBootEnrollKeysOff,
341
	_SDBootEnrollKeysLowerName[18:21]: SDBootEnrollKeysOff,
342
}
343

344
var _SDBootEnrollKeysNames = []string{
345
	_SDBootEnrollKeysName[0:7],
346
	_SDBootEnrollKeysName[7:13],
347
	_SDBootEnrollKeysName[13:18],
348
	_SDBootEnrollKeysName[18:21],
349
}
350

351
// SDBootEnrollKeysString retrieves an enum value from the enum constants string name.
352
// Throws an error if the param is not part of the enum.
353
func SDBootEnrollKeysString(s string) (SDBootEnrollKeys, error) {
354
	if val, ok := _SDBootEnrollKeysNameToValueMap[s]; ok {
355
		return val, nil
356
	}
357

358
	if val, ok := _SDBootEnrollKeysNameToValueMap[strings.ToLower(s)]; ok {
359
		return val, nil
360
	}
361
	return 0, fmt.Errorf("%s does not belong to SDBootEnrollKeys values", s)
362
}
363

364
// SDBootEnrollKeysValues returns all values of the enum
365
func SDBootEnrollKeysValues() []SDBootEnrollKeys {
366
	return _SDBootEnrollKeysValues
367
}
368

369
// SDBootEnrollKeysStrings returns a slice of all String values of the enum
370
func SDBootEnrollKeysStrings() []string {
371
	strs := make([]string, len(_SDBootEnrollKeysNames))
372
	copy(strs, _SDBootEnrollKeysNames)
373
	return strs
374
}
375

376
// IsASDBootEnrollKeys returns "true" if the value is listed in the enum definition. "false" otherwise
377
func (i SDBootEnrollKeys) IsASDBootEnrollKeys() bool {
378
	for _, v := range _SDBootEnrollKeysValues {
379
		if i == v {
380
			return true
381
		}
382
	}
383
	return false
384
}
385

386
// MarshalText implements the encoding.TextMarshaler interface for SDBootEnrollKeys
387
func (i SDBootEnrollKeys) MarshalText() ([]byte, error) {
388
	return []byte(i.String()), nil
389
}
390

391
// UnmarshalText implements the encoding.TextUnmarshaler interface for SDBootEnrollKeys
392
func (i *SDBootEnrollKeys) UnmarshalText(text []byte) error {
393
	var err error
394
	*i, err = SDBootEnrollKeysString(string(text))
395
	return err
396
}
397

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.