-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes_enum.go
More file actions
116 lines (103 loc) · 4.07 KB
/
types_enum.go
File metadata and controls
116 lines (103 loc) · 4.07 KB
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
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package codegen
import (
"fmt"
"strings"
)
const (
// SubstreamsSinkChoiceNone is a SubstreamsSinkChoice of type none.
SubstreamsSinkChoiceNone SubstreamsSinkChoice = "none"
// SubstreamsSinkChoiceSourceOnly is a SubstreamsSinkChoice of type source_only.
SubstreamsSinkChoiceSourceOnly SubstreamsSinkChoice = "source_only"
// SubstreamsSinkChoicePostgres is a SubstreamsSinkChoice of type postgres.
SubstreamsSinkChoicePostgres SubstreamsSinkChoice = "postgres"
// SubstreamsSinkChoiceClickhouse is a SubstreamsSinkChoice of type clickhouse.
SubstreamsSinkChoiceClickhouse SubstreamsSinkChoice = "clickhouse"
// SubstreamsSinkChoiceParquet is a SubstreamsSinkChoice of type parquet.
SubstreamsSinkChoiceParquet SubstreamsSinkChoice = "parquet"
// SubstreamsSinkChoiceGolang is a SubstreamsSinkChoice of type golang.
SubstreamsSinkChoiceGolang SubstreamsSinkChoice = "golang"
// SubstreamsSinkChoiceRust is a SubstreamsSinkChoice of type rust.
SubstreamsSinkChoiceRust SubstreamsSinkChoice = "rust"
// SubstreamsSinkChoiceJavascript is a SubstreamsSinkChoice of type javascript.
SubstreamsSinkChoiceJavascript SubstreamsSinkChoice = "javascript"
// SubstreamsSinkChoicePython is a SubstreamsSinkChoice of type python.
SubstreamsSinkChoicePython SubstreamsSinkChoice = "python"
)
var ErrInvalidSubstreamsSinkChoice = fmt.Errorf("not a valid SubstreamsSinkChoice, try [%s]", strings.Join(_SubstreamsSinkChoiceNames, ", "))
var _SubstreamsSinkChoiceNames = []string{
string(SubstreamsSinkChoiceNone),
string(SubstreamsSinkChoiceSourceOnly),
string(SubstreamsSinkChoicePostgres),
string(SubstreamsSinkChoiceClickhouse),
string(SubstreamsSinkChoiceParquet),
string(SubstreamsSinkChoiceGolang),
string(SubstreamsSinkChoiceRust),
string(SubstreamsSinkChoiceJavascript),
string(SubstreamsSinkChoicePython),
}
// SubstreamsSinkChoiceNames returns a list of possible string values of SubstreamsSinkChoice.
func SubstreamsSinkChoiceNames() []string {
tmp := make([]string, len(_SubstreamsSinkChoiceNames))
copy(tmp, _SubstreamsSinkChoiceNames)
return tmp
}
// SubstreamsSinkChoiceValues returns a list of the values for SubstreamsSinkChoice
func SubstreamsSinkChoiceValues() []SubstreamsSinkChoice {
return []SubstreamsSinkChoice{
SubstreamsSinkChoiceNone,
SubstreamsSinkChoiceSourceOnly,
SubstreamsSinkChoicePostgres,
SubstreamsSinkChoiceClickhouse,
SubstreamsSinkChoiceParquet,
SubstreamsSinkChoiceGolang,
SubstreamsSinkChoiceRust,
SubstreamsSinkChoiceJavascript,
SubstreamsSinkChoicePython,
}
}
// String implements the Stringer interface.
func (x SubstreamsSinkChoice) String() string {
return string(x)
}
// IsValid provides a quick way to determine if the typed value is
// part of the allowed enumerated values
func (x SubstreamsSinkChoice) IsValid() bool {
_, err := ParseSubstreamsSinkChoice(string(x))
return err == nil
}
var _SubstreamsSinkChoiceValue = map[string]SubstreamsSinkChoice{
"none": SubstreamsSinkChoiceNone,
"source_only": SubstreamsSinkChoiceSourceOnly,
"postgres": SubstreamsSinkChoicePostgres,
"clickhouse": SubstreamsSinkChoiceClickhouse,
"parquet": SubstreamsSinkChoiceParquet,
"golang": SubstreamsSinkChoiceGolang,
"rust": SubstreamsSinkChoiceRust,
"javascript": SubstreamsSinkChoiceJavascript,
"python": SubstreamsSinkChoicePython,
}
// ParseSubstreamsSinkChoice attempts to convert a string to a SubstreamsSinkChoice.
func ParseSubstreamsSinkChoice(name string) (SubstreamsSinkChoice, error) {
if x, ok := _SubstreamsSinkChoiceValue[name]; ok {
return x, nil
}
return SubstreamsSinkChoice(""), fmt.Errorf("%s is %w", name, ErrInvalidSubstreamsSinkChoice)
}
// MarshalText implements the text marshaller method.
func (x SubstreamsSinkChoice) MarshalText() ([]byte, error) {
return []byte(string(x)), nil
}
// UnmarshalText implements the text unmarshaller method.
func (x *SubstreamsSinkChoice) UnmarshalText(text []byte) error {
tmp, err := ParseSubstreamsSinkChoice(string(text))
if err != nil {
return err
}
*x = tmp
return nil
}