2024-10-04 13:15:41 +00:00
|
|
|
// Code generated by "enumer -type instanceIndex -linecomment"; DO NOT EDIT.
|
2024-09-25 19:40:21 +00:00
|
|
|
|
|
|
|
package query
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
const _instanceIndexName = "instanceIndexByIDinstanceIndexByHost"
|
|
|
|
|
2024-10-04 13:15:41 +00:00
|
|
|
var _instanceIndexIndex = [...]uint8{0, 0, 17, 36}
|
2024-09-25 19:40:21 +00:00
|
|
|
|
|
|
|
const _instanceIndexLowerName = "instanceindexbyidinstanceindexbyhost"
|
|
|
|
|
|
|
|
func (i instanceIndex) String() string {
|
|
|
|
if i < 0 || i >= instanceIndex(len(_instanceIndexIndex)-1) {
|
|
|
|
return fmt.Sprintf("instanceIndex(%d)", i)
|
|
|
|
}
|
|
|
|
return _instanceIndexName[_instanceIndexIndex[i]:_instanceIndexIndex[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 _instanceIndexNoOp() {
|
|
|
|
var x [1]struct{}
|
2024-10-04 13:15:41 +00:00
|
|
|
_ = x[instanceIndexUnspecified-(0)]
|
|
|
|
_ = x[instanceIndexByID-(1)]
|
|
|
|
_ = x[instanceIndexByHost-(2)]
|
2024-09-25 19:40:21 +00:00
|
|
|
}
|
|
|
|
|
2024-10-04 13:15:41 +00:00
|
|
|
var _instanceIndexValues = []instanceIndex{instanceIndexUnspecified, instanceIndexByID, instanceIndexByHost}
|
2024-09-25 19:40:21 +00:00
|
|
|
|
|
|
|
var _instanceIndexNameToValueMap = map[string]instanceIndex{
|
2024-10-04 13:15:41 +00:00
|
|
|
_instanceIndexName[0:0]: instanceIndexUnspecified,
|
|
|
|
_instanceIndexLowerName[0:0]: instanceIndexUnspecified,
|
2024-09-25 19:40:21 +00:00
|
|
|
_instanceIndexName[0:17]: instanceIndexByID,
|
|
|
|
_instanceIndexLowerName[0:17]: instanceIndexByID,
|
|
|
|
_instanceIndexName[17:36]: instanceIndexByHost,
|
|
|
|
_instanceIndexLowerName[17:36]: instanceIndexByHost,
|
|
|
|
}
|
|
|
|
|
|
|
|
var _instanceIndexNames = []string{
|
2024-10-04 13:15:41 +00:00
|
|
|
_instanceIndexName[0:0],
|
2024-09-25 19:40:21 +00:00
|
|
|
_instanceIndexName[0:17],
|
|
|
|
_instanceIndexName[17:36],
|
|
|
|
}
|
|
|
|
|
|
|
|
// instanceIndexString retrieves an enum value from the enum constants string name.
|
|
|
|
// Throws an error if the param is not part of the enum.
|
|
|
|
func instanceIndexString(s string) (instanceIndex, error) {
|
|
|
|
if val, ok := _instanceIndexNameToValueMap[s]; ok {
|
|
|
|
return val, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
if val, ok := _instanceIndexNameToValueMap[strings.ToLower(s)]; ok {
|
|
|
|
return val, nil
|
|
|
|
}
|
|
|
|
return 0, fmt.Errorf("%s does not belong to instanceIndex values", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
// instanceIndexValues returns all values of the enum
|
|
|
|
func instanceIndexValues() []instanceIndex {
|
|
|
|
return _instanceIndexValues
|
|
|
|
}
|
|
|
|
|
|
|
|
// instanceIndexStrings returns a slice of all String values of the enum
|
|
|
|
func instanceIndexStrings() []string {
|
|
|
|
strs := make([]string, len(_instanceIndexNames))
|
|
|
|
copy(strs, _instanceIndexNames)
|
|
|
|
return strs
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsAinstanceIndex returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
|
|
func (i instanceIndex) IsAinstanceIndex() bool {
|
|
|
|
for _, v := range _instanceIndexValues {
|
|
|
|
if i == v {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|