mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
c165ed07f4
# Which Problems Are Solved Organizations are ofter searched for by ID or primary domain. This results in many redundant queries, resulting in a performance impact. # How the Problems Are Solved Cache Organizaion objects by ID and primary domain. # Additional Changes - Adjust integration test config to use all types of cache. - Adjust integration test lifetimes so the pruner has something to do while the tests run. # Additional Context - Closes #8865 - After #8902
87 lines
2.4 KiB
Go
87 lines
2.4 KiB
Go
// Code generated by "enumer -type Purpose -transform snake -trimprefix Purpose"; DO NOT EDIT.
|
|
|
|
package cache
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
const _PurposeName = "unspecifiedauthz_instancemilestonesorganization"
|
|
|
|
var _PurposeIndex = [...]uint8{0, 11, 25, 35, 47}
|
|
|
|
const _PurposeLowerName = "unspecifiedauthz_instancemilestonesorganization"
|
|
|
|
func (i Purpose) String() string {
|
|
if i < 0 || i >= Purpose(len(_PurposeIndex)-1) {
|
|
return fmt.Sprintf("Purpose(%d)", i)
|
|
}
|
|
return _PurposeName[_PurposeIndex[i]:_PurposeIndex[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 _PurposeNoOp() {
|
|
var x [1]struct{}
|
|
_ = x[PurposeUnspecified-(0)]
|
|
_ = x[PurposeAuthzInstance-(1)]
|
|
_ = x[PurposeMilestones-(2)]
|
|
_ = x[PurposeOrganization-(3)]
|
|
}
|
|
|
|
var _PurposeValues = []Purpose{PurposeUnspecified, PurposeAuthzInstance, PurposeMilestones, PurposeOrganization}
|
|
|
|
var _PurposeNameToValueMap = map[string]Purpose{
|
|
_PurposeName[0:11]: PurposeUnspecified,
|
|
_PurposeLowerName[0:11]: PurposeUnspecified,
|
|
_PurposeName[11:25]: PurposeAuthzInstance,
|
|
_PurposeLowerName[11:25]: PurposeAuthzInstance,
|
|
_PurposeName[25:35]: PurposeMilestones,
|
|
_PurposeLowerName[25:35]: PurposeMilestones,
|
|
_PurposeName[35:47]: PurposeOrganization,
|
|
_PurposeLowerName[35:47]: PurposeOrganization,
|
|
}
|
|
|
|
var _PurposeNames = []string{
|
|
_PurposeName[0:11],
|
|
_PurposeName[11:25],
|
|
_PurposeName[25:35],
|
|
_PurposeName[35:47],
|
|
}
|
|
|
|
// PurposeString retrieves an enum value from the enum constants string name.
|
|
// Throws an error if the param is not part of the enum.
|
|
func PurposeString(s string) (Purpose, error) {
|
|
if val, ok := _PurposeNameToValueMap[s]; ok {
|
|
return val, nil
|
|
}
|
|
|
|
if val, ok := _PurposeNameToValueMap[strings.ToLower(s)]; ok {
|
|
return val, nil
|
|
}
|
|
return 0, fmt.Errorf("%s does not belong to Purpose values", s)
|
|
}
|
|
|
|
// PurposeValues returns all values of the enum
|
|
func PurposeValues() []Purpose {
|
|
return _PurposeValues
|
|
}
|
|
|
|
// PurposeStrings returns a slice of all String values of the enum
|
|
func PurposeStrings() []string {
|
|
strs := make([]string, len(_PurposeNames))
|
|
copy(strs, _PurposeNames)
|
|
return strs
|
|
}
|
|
|
|
// IsAPurpose returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
func (i Purpose) IsAPurpose() bool {
|
|
for _, v := range _PurposeValues {
|
|
if i == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|