aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ClickHouse/ch-go/proto/client_info_query_enum.go
blob: e8a15e077f289764c0d352b7fae19a39dd787356 (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
// Code generated by "enumer -type ClientQueryKind -trimprefix ClientQueryKind -output client_info_query_enum.go"; DO NOT EDIT.

package proto

import (
	"fmt"
	"strings"
)

const _ClientQueryKindName = "ClientQueryNoneClientQueryInitialClientQuerySecondary"

var _ClientQueryKindIndex = [...]uint8{0, 15, 33, 53}

const _ClientQueryKindLowerName = "clientquerynoneclientqueryinitialclientquerysecondary"

func (i ClientQueryKind) String() string {
	if i >= ClientQueryKind(len(_ClientQueryKindIndex)-1) {
		return fmt.Sprintf("ClientQueryKind(%d)", i)
	}
	return _ClientQueryKindName[_ClientQueryKindIndex[i]:_ClientQueryKindIndex[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 _ClientQueryKindNoOp() {
	var x [1]struct{}
	_ = x[ClientQueryNone-(0)]
	_ = x[ClientQueryInitial-(1)]
	_ = x[ClientQuerySecondary-(2)]
}

var _ClientQueryKindValues = []ClientQueryKind{ClientQueryNone, ClientQueryInitial, ClientQuerySecondary}

var _ClientQueryKindNameToValueMap = map[string]ClientQueryKind{
	_ClientQueryKindName[0:15]:       ClientQueryNone,
	_ClientQueryKindLowerName[0:15]:  ClientQueryNone,
	_ClientQueryKindName[15:33]:      ClientQueryInitial,
	_ClientQueryKindLowerName[15:33]: ClientQueryInitial,
	_ClientQueryKindName[33:53]:      ClientQuerySecondary,
	_ClientQueryKindLowerName[33:53]: ClientQuerySecondary,
}

var _ClientQueryKindNames = []string{
	_ClientQueryKindName[0:15],
	_ClientQueryKindName[15:33],
	_ClientQueryKindName[33:53],
}

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

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

// ClientQueryKindValues returns all values of the enum
func ClientQueryKindValues() []ClientQueryKind {
	return _ClientQueryKindValues
}

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

// IsAClientQueryKind returns "true" if the value is listed in the enum definition. "false" otherwise
func (i ClientQueryKind) IsAClientQueryKind() bool {
	for _, v := range _ClientQueryKindValues {
		if i == v {
			return true
		}
	}
	return false
}