aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ClickHouse/ch-go/proto/feature_enum.go
blob: 95b453f356c96da9579a950835b6d4273f26c5bb (plain) (blame)
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
// Code generated by "enumer -type Feature -trimprefix Feature -output feature_enum.go"; DO NOT EDIT.

package proto

import (
	"fmt"
	"strings"
)

const _FeatureName = "TempTablesBlockInfoTimezoneQuotaKeyInClientInfoDisplayNameVersionPatchServerLogsColumnDefaultsMetadataClientWriteInfoSettingsSerializedAsStringsInterServerSecretOpenTelemetryXForwardedForInClientInfoRefererInClientInfoDistributedDepthQueryStartTimeProfileEventsParallelReplicasCustomSerializationQuotaKeyParametersServerQueryTimeInProgress"
const _FeatureLowerName = "temptablesblockinfotimezonequotakeyinclientinfodisplaynameversionpatchserverlogscolumndefaultsmetadataclientwriteinfosettingsserializedasstringsinterserversecretopentelemetryxforwardedforinclientinforefererinclientinfodistributeddepthquerystarttimeprofileeventsparallelreplicascustomserializationquotakeyparametersserverquerytimeinprogress"

var _FeatureMap = map[Feature]string{
	50264: _FeatureName[0:10],
	51903: _FeatureName[10:19],
	54058: _FeatureName[19:27],
	54060: _FeatureName[27:47],
	54372: _FeatureName[47:58],
	54401: _FeatureName[58:70],
	54406: _FeatureName[70:80],
	54410: _FeatureName[80:102],
	54420: _FeatureName[102:117],
	54429: _FeatureName[117:144],
	54441: _FeatureName[144:161],
	54442: _FeatureName[161:174],
	54443: _FeatureName[174:199],
	54447: _FeatureName[199:218],
	54448: _FeatureName[218:234],
	54449: _FeatureName[234:248],
	54451: _FeatureName[248:261],
	54453: _FeatureName[261:277],
	54454: _FeatureName[277:296],
	54458: _FeatureName[296:304],
	54459: _FeatureName[304:314],
	54460: _FeatureName[314:339],
}

func (i Feature) String() string {
	if str, ok := _FeatureMap[i]; ok {
		return str
	}
	return fmt.Sprintf("Feature(%d)", i)
}

// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _FeatureNoOp() {
	var x [1]struct{}
	_ = x[FeatureTempTables-(50264)]
	_ = x[FeatureBlockInfo-(51903)]
	_ = x[FeatureTimezone-(54058)]
	_ = x[FeatureQuotaKeyInClientInfo-(54060)]
	_ = x[FeatureDisplayName-(54372)]
	_ = x[FeatureVersionPatch-(54401)]
	_ = x[FeatureServerLogs-(54406)]
	_ = x[FeatureColumnDefaultsMetadata-(54410)]
	_ = x[FeatureClientWriteInfo-(54420)]
	_ = x[FeatureSettingsSerializedAsStrings-(54429)]
	_ = x[FeatureInterServerSecret-(54441)]
	_ = x[FeatureOpenTelemetry-(54442)]
	_ = x[FeatureXForwardedForInClientInfo-(54443)]
	_ = x[FeatureRefererInClientInfo-(54447)]
	_ = x[FeatureDistributedDepth-(54448)]
	_ = x[FeatureQueryStartTime-(54449)]
	_ = x[FeatureProfileEvents-(54451)]
	_ = x[FeatureParallelReplicas-(54453)]
	_ = x[FeatureCustomSerialization-(54454)]
	_ = x[FeatureQuotaKey-(54458)]
	_ = x[FeatureParameters-(54459)]
	_ = x[FeatureServerQueryTimeInProgress-(54460)]
}

var _FeatureValues = []Feature{FeatureTempTables, FeatureBlockInfo, FeatureTimezone, FeatureQuotaKeyInClientInfo, FeatureDisplayName, FeatureVersionPatch, FeatureServerLogs, FeatureColumnDefaultsMetadata, FeatureClientWriteInfo, FeatureSettingsSerializedAsStrings, FeatureInterServerSecret, FeatureOpenTelemetry, FeatureXForwardedForInClientInfo, FeatureRefererInClientInfo, FeatureDistributedDepth, FeatureQueryStartTime, FeatureProfileEvents, FeatureParallelReplicas, FeatureCustomSerialization, FeatureQuotaKey, FeatureParameters, FeatureServerQueryTimeInProgress}

var _FeatureNameToValueMap = map[string]Feature{
	_FeatureName[0:10]:         FeatureTempTables,
	_FeatureLowerName[0:10]:    FeatureTempTables,
	_FeatureName[10:19]:        FeatureBlockInfo,
	_FeatureLowerName[10:19]:   FeatureBlockInfo,
	_FeatureName[19:27]:        FeatureTimezone,
	_FeatureLowerName[19:27]:   FeatureTimezone,
	_FeatureName[27:47]:        FeatureQuotaKeyInClientInfo,
	_FeatureLowerName[27:47]:   FeatureQuotaKeyInClientInfo,
	_FeatureName[47:58]:        FeatureDisplayName,
	_FeatureLowerName[47:58]:   FeatureDisplayName,
	_FeatureName[58:70]:        FeatureVersionPatch,
	_FeatureLowerName[58:70]:   FeatureVersionPatch,
	_FeatureName[70:80]:        FeatureServerLogs,
	_FeatureLowerName[70:80]:   FeatureServerLogs,
	_FeatureName[80:102]:       FeatureColumnDefaultsMetadata,
	_FeatureLowerName[80:102]:  FeatureColumnDefaultsMetadata,
	_FeatureName[102:117]:      FeatureClientWriteInfo,
	_FeatureLowerName[102:117]: FeatureClientWriteInfo,
	_FeatureName[117:144]:      FeatureSettingsSerializedAsStrings,
	_FeatureLowerName[117:144]: FeatureSettingsSerializedAsStrings,
	_FeatureName[144:161]:      FeatureInterServerSecret,
	_FeatureLowerName[144:161]: FeatureInterServerSecret,
	_FeatureName[161:174]:      FeatureOpenTelemetry,
	_FeatureLowerName[161:174]: FeatureOpenTelemetry,
	_FeatureName[174:199]:      FeatureXForwardedForInClientInfo,
	_FeatureLowerName[174:199]: FeatureXForwardedForInClientInfo,
	_FeatureName[199:218]:      FeatureRefererInClientInfo,
	_FeatureLowerName[199:218]: FeatureRefererInClientInfo,
	_FeatureName[218:234]:      FeatureDistributedDepth,
	_FeatureLowerName[218:234]: FeatureDistributedDepth,
	_FeatureName[234:248]:      FeatureQueryStartTime,
	_FeatureLowerName[234:248]: FeatureQueryStartTime,
	_FeatureName[248:261]:      FeatureProfileEvents,
	_FeatureLowerName[248:261]: FeatureProfileEvents,
	_FeatureName[261:277]:      FeatureParallelReplicas,
	_FeatureLowerName[261:277]: FeatureParallelReplicas,
	_FeatureName[277:296]:      FeatureCustomSerialization,
	_FeatureLowerName[277:296]: FeatureCustomSerialization,
	_FeatureName[296:304]:      FeatureQuotaKey,
	_FeatureLowerName[296:304]: FeatureQuotaKey,
	_FeatureName[304:314]:      FeatureParameters,
	_FeatureLowerName[304:314]: FeatureParameters,
	_FeatureName[314:339]:      FeatureServerQueryTimeInProgress,
	_FeatureLowerName[314:339]: FeatureServerQueryTimeInProgress,
}

var _FeatureNames = []string{
	_FeatureName[0:10],
	_FeatureName[10:19],
	_FeatureName[19:27],
	_FeatureName[27:47],
	_FeatureName[47:58],
	_FeatureName[58:70],
	_FeatureName[70:80],
	_FeatureName[80:102],
	_FeatureName[102:117],
	_FeatureName[117:144],
	_FeatureName[144:161],
	_FeatureName[161:174],
	_FeatureName[174:199],
	_FeatureName[199:218],
	_FeatureName[218:234],
	_FeatureName[234:248],
	_FeatureName[248:261],
	_FeatureName[261:277],
	_FeatureName[277:296],
	_FeatureName[296:304],
	_FeatureName[304:314],
	_FeatureName[314:339],
}

// FeatureString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func FeatureString(s string) (Feature, error) {
	if val, ok := _FeatureNameToValueMap[s]; ok {
		return val, nil
	}

	if val, ok := _FeatureNameToValueMap[strings.ToLower(s)]; ok {
		return val, nil
	}
	return 0, fmt.Errorf("%s does not belong to Feature values", s)
}

// FeatureValues returns all values of the enum
func FeatureValues() []Feature {
	return _FeatureValues
}

// FeatureStrings returns a slice of all String values of the enum
func FeatureStrings() []string {
	strs := make([]string, len(_FeatureNames))
	copy(strs, _FeatureNames)
	return strs
}

// IsAFeature returns "true" if the value is listed in the enum definition. "false" otherwise
func (i Feature) IsAFeature() bool {
	_, ok := _FeatureMap[i]
	return ok
}