Files
native/proto/col_low_cardinality_enum.go
zeekay 765c3d0aa1 hanzo-ds/native: de-branded native protocol lib (fork of clickhouse ch-go v0.71.0)
Module path, package names, and identifiers de-branded to native/proto/compress/
pool/tracing. Server wire-protocol strings preserved. Vendored codec surface used
by hanzo-ds/go (proto + compress).
2026-07-10 13:10:07 -07:00

87 lines
2.5 KiB
Go

// Code generated by "enumer -type CardinalityKey -trimprefix Key -output col_low_cardinality_enum.go"; DO NOT EDIT.
package proto
import (
"fmt"
"strings"
)
const _CardinalityKeyName = "UInt8UInt16UInt32UInt64"
var _CardinalityKeyIndex = [...]uint8{0, 5, 11, 17, 23}
const _CardinalityKeyLowerName = "uint8uint16uint32uint64"
func (i CardinalityKey) String() string {
if i >= CardinalityKey(len(_CardinalityKeyIndex)-1) {
return fmt.Sprintf("CardinalityKey(%d)", i)
}
return _CardinalityKeyName[_CardinalityKeyIndex[i]:_CardinalityKeyIndex[i+1]]
}
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
func _CardinalityKeyNoOp() {
var x [1]struct{}
_ = x[KeyUInt8-(0)]
_ = x[KeyUInt16-(1)]
_ = x[KeyUInt32-(2)]
_ = x[KeyUInt64-(3)]
}
var _CardinalityKeyValues = []CardinalityKey{KeyUInt8, KeyUInt16, KeyUInt32, KeyUInt64}
var _CardinalityKeyNameToValueMap = map[string]CardinalityKey{
_CardinalityKeyName[0:5]: KeyUInt8,
_CardinalityKeyLowerName[0:5]: KeyUInt8,
_CardinalityKeyName[5:11]: KeyUInt16,
_CardinalityKeyLowerName[5:11]: KeyUInt16,
_CardinalityKeyName[11:17]: KeyUInt32,
_CardinalityKeyLowerName[11:17]: KeyUInt32,
_CardinalityKeyName[17:23]: KeyUInt64,
_CardinalityKeyLowerName[17:23]: KeyUInt64,
}
var _CardinalityKeyNames = []string{
_CardinalityKeyName[0:5],
_CardinalityKeyName[5:11],
_CardinalityKeyName[11:17],
_CardinalityKeyName[17:23],
}
// CardinalityKeyString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func CardinalityKeyString(s string) (CardinalityKey, error) {
if val, ok := _CardinalityKeyNameToValueMap[s]; ok {
return val, nil
}
if val, ok := _CardinalityKeyNameToValueMap[strings.ToLower(s)]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to CardinalityKey values", s)
}
// CardinalityKeyValues returns all values of the enum
func CardinalityKeyValues() []CardinalityKey {
return _CardinalityKeyValues
}
// CardinalityKeyStrings returns a slice of all String values of the enum
func CardinalityKeyStrings() []string {
strs := make([]string, len(_CardinalityKeyNames))
copy(strs, _CardinalityKeyNames)
return strs
}
// IsACardinalityKey returns "true" if the value is listed in the enum definition. "false" otherwise
func (i CardinalityKey) IsACardinalityKey() bool {
for _, v := range _CardinalityKeyValues {
if i == v {
return true
}
}
return false
}