Documentation
¶
Index ¶
- func ByteArrayToAlphaNum(bytes []byte) string
- func ConfigGetInt32(config map[string]string, key string, defaultValue int32) int32
- func Converter(labels map[string]string) *string
- func GetBoolean(labels map[string]string, key string) bool
- func GetEnv() map[string]string
- func GetEnvValueCaseInsensitive(caseInsensitiveKey string) string
- func GetOptional(labels map[string]string, key string) *string
- func IsShared(labels map[string]string) bool
- func IsSingleton(labels map[string]string) bool
- func IsTruthy(s string) bool
- func Sanitize(str string) string
- func SanitizeWithMinLength(str string, minLength int) string
- func ServiceAccountName(labels map[string]string) string
- func StorageClass(labels map[string]string) *string
- func StorageSize(labels map[string]string, fallback string) resource.Quantity
- func StorageSizeRaw(labels map[string]string) *string
- func SubConfig(config map[string]string, prefix string, defaultKey string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToAlphaNum ¶ added in v0.2.0
func ConfigGetInt32 ¶
ConfigGetInt32 extracts the int32 value from the entry with the given key
Returns `defaultValue` if either the entry does not exist, or is not a numeric value.
func GetEnvValueCaseInsensitive ¶ added in v0.5.0
func IsSingleton ¶ added in v0.3.0
IsSingleton determine whether a resource (according to its labels) should be treated as a singleton.
func IsTruthy ¶
IsTruthy determines whether the given string is a representation of a "true" state.
Concretly, it currently tests for "true", "yes" or "1", ignoring character cases.
func Sanitize ¶
Sanitize ensures a string only contains alphanumeric characters, and starts with a letter
func SanitizeWithMinLength ¶
SanitizeWithMinLength applies `Sanitize`, and then ensures the result is at least `minLength` characters long.
If the resulting string is too short, a stable generated value of `minLength` characters will be returned.
func ServiceAccountName ¶ added in v0.4.0
func StorageClass ¶ added in v0.3.0
StorageClass determines a storage class from a set of labels
func StorageSize ¶ added in v0.3.0
StorageSize determines the requested storage size for a volume, or a fallback value.
func StorageSizeRaw ¶ added in v0.3.0
func SubConfig ¶
SubConfig extracts the keys that start with a given prefix from a given config map
If there is a key that is EQUAL to the prefix, the entry identified by `defaultKey` will be updated.
If there is a key that is equal to the prefix, AND an entry corresponding to `defaultKey`, the behavior is undefined!
Types ¶
This section is empty.