Documentation
¶
Index ¶
- Variables
- func ByteArrayToUInt(b []byte) uint64
- func CheckRequiredFlag(n, p string)
- func CleanLabel(value any) string
- func CleanName(name string) string
- func ClearBit(n uint32, pos uint) uint32
- func EnvDef(name, def string) string
- func First(strs ...string) string
- func HasBit(n uint32, pos uint) bool
- func IsValidName(name string) bool
- func Join(sep string, elems ...string) string
- func ResolveFlag(curr, envVar, def string) string
- func ResolveFlagBool(curr bool, envVar string, def bool) bool
- func ResolveFlagInt(curr int, envVar string, def int) int
- func SetBit(n uint32, pos uint) uint32
- func ShortHash(hash string) string
- func UIntToByteArray(i uint64) []byte
- type CertPackage
Constants ¶
This section is empty.
Variables ¶
var ( RegexpNameSpecialChar = regexp.MustCompile(`[^a-z0-9]`) RegexpLabelSpecialChar = regexp.MustCompile(`[^a-z0-9A-Z-_\.]`) RegexpLabelPrefix = regexp.MustCompile(`^[^a-z0-9A-Z]*`) RegexpLabelSuffix = regexp.MustCompile(`[^a-z0-9A-Z-_\.]*[^a-z0-9A-Z]*$`) )
Functions ¶
func ByteArrayToUInt ¶
func CheckRequiredFlag ¶
func CheckRequiredFlag(n, p string)
func CleanLabel ¶
CleanLabel returns the label value with all special characters replaced with dashes and any character that is not [a-z0-9A-Z] trimmed from start and end. If name is a path only the basename is used.
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
func CleanName ¶
CleanName returns name with all special characters replaced with dashes and set to lowercase. The string is truncated if longer than 63 characters. If name is a path only the basename is used.
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
func First ¶
First returns the first non-empty string. If all strings are empty then empty string is returned.
func IsValidName ¶
func Join ¶
Join concatenates the elements of its second argument to create a single string. The separator string sep is placed between elements in the resulting string. Empty elements are ignored.