Documentation ¶
Index ¶
- func Bool2Int(flag bool) int
- func Coalesce(val, defaultVal string) string
- func CoalesceBool(val, defaultVal *bool) *bool
- func CoalesceDuration(val time.Duration, defaultVal string) time.Duration
- func CoalesceInt(val, defaultVal int) int
- func CoalesceInt32(val, defaultVal *int32) *int32
- func CoalesceInt64(val, defaultVal int64) int64
- func CoalesceStrArr(val, defaultVal []string) []string
- func CoalesceStrMap(val, defaultVal map[string]string) map[string]string
- func CoalesceUInt32(val, defaultVal uint32) uint32
- func Diff(a, b interface{}) []string
- func False() *bool
- func FindNamedStringSubmatch(r *regexp.Regexp, s string) map[string]string
- func IsEqualIgnoreOrder(a, b []string) bool
- func IsSmallerQuantity(requestStr, limitStr string) (bool, error)
- func MapContains(haystack, needle map[string]string) bool
- func MaxInt32(a, b *int32) *int32
- func MinResource(maxRequestStr, requestStr string) (resource.Quantity, error)
- func NameFromMeta(meta metav1.ObjectMeta) spec.NamespacedName
- func PrettyDiff(a, b interface{}) string
- func RandomPassword(n int) string
- func SliceContains(slice interface{}, item interface{}) bool
- func StringSliceReplaceElement(s []string, a, b string) (result []string)
- func SubstractStringSlices(a []string, b []string) (result []string, equal bool)
- func ToIntStr(val int) *intstr.IntOrString
- func True() *bool
- type Encryptor
- type Hasher
- type Random
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoalesceBool ¶
CoalesceBool works like coalesce but for *bool
func CoalesceDuration ¶
CoalesceDuration works like coalesce but for time.Duration
func CoalesceInt ¶
CoalesceInt works like coalesce but for int
func CoalesceInt32 ¶
CoalesceInt32 works like coalesce but for *int32
func CoalesceInt64 ¶
CoalesceInt64 works like coalesce but for int64
func CoalesceStrArr ¶
CoalesceStrArr returns the first argument if it is not null, otherwise the second one.
func CoalesceStrMap ¶
CoalesceStrMap returns the first argument if it is not null, otherwise the second one.
func CoalesceUInt32 ¶
CoalesceUInt32 works like coalesce but for uint32
func FindNamedStringSubmatch ¶
FindNamedStringSubmatch returns a map of strings holding the text of the matches of the r regular expression
func IsEqualIgnoreOrder ¶
Compare two string slices while ignoring the order of elements
func IsSmallerQuantity ¶
IsSmallerQuantity : checks if first resource is of a smaller quantity than the second
func MapContains ¶
MapContains returns true if and only if haystack contains all the keys from the needle with matching corresponding values
func MaxInt32 ¶
MaxInt32 : Return maximum of two integers provided via pointers. If one value is not defined, return the other one. If both are not defined, result is also undefined, caller needs to check for that.
func NameFromMeta ¶
func NameFromMeta(meta metav1.ObjectMeta) spec.NamespacedName
NameFromMeta converts a metadata object to the NamespacedName name representation.
func PrettyDiff ¶
func PrettyDiff(a, b interface{}) string
PrettyDiff shows the diff between 2 objects in an easy to understand format. It is mainly used for debugging output.
func RandomPassword ¶
RandomPassword generates a secure, random alphanumeric password of a given length.
func StringSliceReplaceElement ¶
SliceReplaceElement
func SubstractStringSlices ¶
SubstractStringSlices finds elements in a that are not in b and return them as a result slice.
func ToIntStr ¶
func ToIntStr(val int) *intstr.IntOrString
ToIntStr converts int to IntOrString type
Types ¶
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}