forked from babyname/fate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter_option_enum.go
57 lines (48 loc) · 1.8 KB
/
filter_option_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
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package fate
import (
"errors"
"fmt"
)
const (
// CharacterFilterTypeDefault is a CharacterFilterType of type Default.
CharacterFilterTypeDefault CharacterFilterType = iota
// CharacterFilterTypeChs is a CharacterFilterType of type Chs.
CharacterFilterTypeChs
// CharacterFilterTypeCht is a CharacterFilterType of type Cht.
CharacterFilterTypeCht
// CharacterFilterTypeKangxi is a CharacterFilterType of type Kangxi.
CharacterFilterTypeKangxi
)
var ErrInvalidCharacterFilterType = errors.New("not a valid CharacterFilterType")
const _CharacterFilterTypeName = "defaultchschtkangxi"
var _CharacterFilterTypeMap = map[CharacterFilterType]string{
CharacterFilterTypeDefault: _CharacterFilterTypeName[0:7],
CharacterFilterTypeChs: _CharacterFilterTypeName[7:10],
CharacterFilterTypeCht: _CharacterFilterTypeName[10:13],
CharacterFilterTypeKangxi: _CharacterFilterTypeName[13:19],
}
// String implements the Stringer interface.
func (x CharacterFilterType) String() string {
if str, ok := _CharacterFilterTypeMap[x]; ok {
return str
}
return fmt.Sprintf("CharacterFilterType(%d)", x)
}
var _CharacterFilterTypeValue = map[string]CharacterFilterType{
_CharacterFilterTypeName[0:7]: CharacterFilterTypeDefault,
_CharacterFilterTypeName[7:10]: CharacterFilterTypeChs,
_CharacterFilterTypeName[10:13]: CharacterFilterTypeCht,
_CharacterFilterTypeName[13:19]: CharacterFilterTypeKangxi,
}
// ParseCharacterFilterType attempts to convert a string to a CharacterFilterType.
func ParseCharacterFilterType(name string) (CharacterFilterType, error) {
if x, ok := _CharacterFilterTypeValue[name]; ok {
return x, nil
}
return CharacterFilterType(0), fmt.Errorf("%s is %w", name, ErrInvalidCharacterFilterType)
}