util

package
v1.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToMap added in v1.20.0

func AddToMap(key, value string, dest map[string]string)

AddToMap ...

func AppendToStringMap

func AppendToStringMap(source map[string]string, dest map[string]string)

AppendToStringMap appends source into dest. If keys are equal, value is overridden

func ArrayToSet

func ArrayToSet(array []string) map[string]bool

ArrayToSet converts an array of string to a set

func Contains

func Contains(s string, array []string) bool

Contains checks if the s string are within the array

func ContainsAll

func ContainsAll(array1 []string, array2 []string) bool

ContainsAll checks if all the elements of the second are in the first array

func FromMapToString

func FromMapToString(labels map[string]string) string

FromMapToString converts a map into a string format such as key1=value1,key2=value2

func GenerateMD5Hash

func GenerateMD5Hash(source map[string]string) string

GenerateMD5Hash will generate a MD5 hash from the given map

func GetBoolOSEnv

func GetBoolOSEnv(key string) bool

GetBoolOSEnv gets a env variable as a boolean

func GetOSEnv

func GetOSEnv(key, fallback string) string

GetOSEnv gets a env variable

func IsProductMode added in v1.12.0

func IsProductMode() bool

IsProductMode returns true if application is running in product mode.

func MapContains added in v1.20.0

func MapContains(source map[string]string, key string, value string) bool

MapContains ...

func MapContainsMap

func MapContainsMap(source, expected map[string]string) bool

MapContainsMap returns true only if source contains expected map

func RandomSuffix

func RandomSuffix() string

RandomSuffix generates a random suffix to be used in names for kubernetes objects

func Remove added in v1.8.0

func Remove(s string, array *[]string) bool

Remove remove string from the array

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL