-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel_format_enum.go
71 lines (61 loc) · 1.94 KB
/
channel_format_enum.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
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package v2
import (
"fmt"
"strings"
)
const (
// FormatTypeDisable is a FormatType of type Disable.
FormatTypeDisable FormatType = iota
// FormatTypeFields is a FormatType of type Fields.
FormatTypeFields
// FormatTypeJq is a FormatType of type Jq.
FormatTypeJq
)
const _FormatTypeName = "disablefieldsjq"
var _FormatTypeNames = []string{
_FormatTypeName[0:7],
_FormatTypeName[7:13],
_FormatTypeName[13:15],
}
// FormatTypeNames returns a list of possible string values of FormatType.
func FormatTypeNames() []string {
tmp := make([]string, len(_FormatTypeNames))
copy(tmp, _FormatTypeNames)
return tmp
}
var _FormatTypeMap = map[FormatType]string{
FormatTypeDisable: _FormatTypeName[0:7],
FormatTypeFields: _FormatTypeName[7:13],
FormatTypeJq: _FormatTypeName[13:15],
}
// String implements the Stringer interface.
func (x FormatType) String() string {
if str, ok := _FormatTypeMap[x]; ok {
return str
}
return fmt.Sprintf("FormatType(%d)", x)
}
var _FormatTypeValue = map[string]FormatType{
_FormatTypeName[0:7]: FormatTypeDisable,
strings.ToLower(_FormatTypeName[0:7]): FormatTypeDisable,
_FormatTypeName[7:13]: FormatTypeFields,
strings.ToLower(_FormatTypeName[7:13]): FormatTypeFields,
_FormatTypeName[13:15]: FormatTypeJq,
strings.ToLower(_FormatTypeName[13:15]): FormatTypeJq,
}
// ParseFormatType attempts to convert a string to a FormatType.
func ParseFormatType(name string) (FormatType, error) {
if x, ok := _FormatTypeValue[name]; ok {
return x, nil
}
// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.
if x, ok := _FormatTypeValue[strings.ToLower(name)]; ok {
return x, nil
}
return FormatType(0), fmt.Errorf("%s is not a valid FormatType, try [%s]", name, strings.Join(_FormatTypeNames, ", "))
}