Documentation ¶
Index ¶
- func ArrayEqual(a, b []string) bool
- func ArrayEqualElements(a, b []string) bool
- func BoolPtr(value bool) *bool
- func ContainsString(s []string, e string) bool
- func EqualStringLists(list1, list2 []string) bool
- func EqualStringMaps(map1, map2 map[string]string) bool
- func EqualStringsAsPtr(s1, s2 *string) bool
- func FormatTime(time *metav1.Time) string
- func FormatTimestamp(timestamp time.Time) string
- func GenerateRandomKey(length int) []byte
- func IsNil(obj interface{}) bool
- func ParseTimestamp(timestamp string) (time.Time, error)
- func ParseTimestampBy(layout, timestamp string) (time.Time, error)
- func ParseTimestampNillable(timestamp string) *time.Time
- func RandString(length int) string
- func RandStringSeed(length int, src rand.Source) string
- func RandStringStrSeed(length int, src string) string
- func ShortenString(s string, charsToCut int) string
- func StringPtr(s string) *string
- func StringUnPtr(s *string) string
- func StringUnPtrDefault(s *string, defaultValue string) string
- func TernaryString(condition bool, trueValue, falseValue string) string
- func ToLowerCase(slice []string) []string
- type Clock
- type FakeClock
- type RealClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayEqual ¶ added in v1.1.0
ArrayEqual tells whether a and b contain the same elements at the same index. A nil argument is equivalent to an empty slice.
func ArrayEqualElements ¶ added in v1.1.0
ArrayEqualElements tells whether a and b contain the same elements. Elements does not need to be in same index A nil argument is equivalent to an empty slice.
func BoolPtr ¶ added in v1.1.0
BoolPtr returns a pointer to the passed bool. Deprecated - use pointers.Ptr
func ContainsString ¶ added in v1.1.0
ContainsString return if a string is contained in the slice
func EqualStringLists ¶
EqualStringLists Compare two string lists
func EqualStringMaps ¶
EqualStringMaps Compare two string maps
func EqualStringsAsPtr ¶
func FormatTime ¶ added in v1.1.0
FormatTime Converts kubernetes time to formatted timestamp
func FormatTimestamp ¶ added in v1.1.0
FormatTimestamp Converts time to formatted timestamp
func GenerateRandomKey ¶ added in v1.1.9
GenerateRandomKey generates a cryptographically secure random key
func IsNil ¶ added in v1.2.1
func IsNil(obj interface{}) bool
IsNil check if the object is nil or an interface pointer contain nil
func ParseTimestamp ¶ added in v1.1.0
ParseTimestamp Converts timestamp to time by RFC3339 layout
func ParseTimestampBy ¶ added in v1.1.1
ParseTimestampBy Converts timestamp to time by custom layout
func ParseTimestampNillable ¶ added in v1.1.0
ParseTimestampNillable Converts timestamp to time or nil
func RandString ¶ added in v1.1.0
RandString Returns a random string of given length
func RandStringSeed ¶ added in v1.1.0
RandStringSeed Returns a random string of given length from seed
func RandStringStrSeed ¶ added in v1.1.0
RandStringStrSeed Returns a random string of given length from seed
func ShortenString ¶
ShortenString Get string without n-last chars
func StringUnPtr ¶ added in v1.1.7
StringUnPtr returns a string from a string pointer.
func StringUnPtrDefault ¶ added in v1.1.7
StringUnPtrDefault returns a string from a string pointer, or default value, if nil.
func TernaryString ¶
TernaryString operator
func ToLowerCase ¶ added in v1.1.0
ToLowerCase Convert all strings in a list to lower case
Types ¶
type FakeClock ¶ added in v1.1.0
type FakeClock struct {
// contains filtered or unexported fields
}