utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteMapsMatch

func ByteMapsMatch(m1, m2 map[string][]byte) bool

ByteMapsMatch is like stringMapsMatch but for maps of byte arrays

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if a slice contains a particular string

func CreateFakeHash

func CreateFakeHash(m map[string]string) string

func FindAllGroups

func FindAllGroups(re *regexp.Regexp, s string) map[string]string

FindAllGroups returns a map with each match group. The map key corresponds to the match group name. A nil return value indicates no matches.

func K8sSecretFound

func K8sSecretFound(m map[string]string) bool

func MergeMap

func MergeMap(dst map[string]string, src map[string]string)

func RemoveString

func RemoveString(slice []string, s string) (result []string)

RemoveString returns a copy of a slice with the specified string removed if it is found

func SecretHashString

func SecretHashString(m map[string]string) string

func SortedKeysMapString

func SortedKeysMapString(m map[string]string) []string

func StringMapsMatch

func StringMapsMatch(m1, m2 map[string]string, ignoreKeys []string) bool

StringMapsMatch returns true if the provided maps contain the same keys and values, otherwise false

func ValueOrDefault

func ValueOrDefault(value, defaultValue string) string

func ValueOrDefaultBool

func ValueOrDefaultBool(value, defaultValue bool) bool

func ValueOrDefaultInt

func ValueOrDefaultInt(value, defaultValue int) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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