Documentation ¶
Index ¶
- func AddStringIfMissing(slice []string, s string) (bool, []string)
- func IsZeroDuration(d *metav1.Duration) bool
- func Metav1Duration(d time.Duration) *metav1.Duration
- func RandomAlphaNumString(length int64) (string, error)
- func RemoveString(slice []string, s string) (bool, []string)
- func ShortenMessage(message string, length int) (shortenedMessage string)
- func StringSliceContains(slice []string, elem string) bool
- func Trim(input string) (output string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddStringIfMissing ¶
AddStringIfMissing adds a string to a slice of strings The provided slice is not changed returns true, slice with appended string if string was not in the list returns false, old list if string was already in the list
func IsZeroDuration ¶ added in v0.27.1
IsZeroDuration returns true if duration is nil or duration is zero seconds
func Metav1Duration ¶ added in v0.27.1
Metav1Duration converts a time.Duration to a metav1.Duration pointer
func RandomAlphaNumString ¶
RandomAlphaNumString generates a random string value consisting of [0-9a-z] with a length as configured.
func RemoveString ¶
RemoveString removes a string from a slice of strings The provided slice is not changed returns true, slice with removed string if string was contained in the list returns false, old list if string was not in the list
func ShortenMessage ¶
ShortenMessage Removes line breaks and shortens the message
func StringSliceContains ¶
StringSliceContains determines whether the given string slice contains a given element.
Types ¶
This section is empty.