util

package
v0.0.0-...-9dbba9d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErrorType

func CheckErrorType(t *testing.T, err error, errCode apperrors.ErrCode)

func Close

func Close(closer io.ReadCloser)

func CreateGardenerClusterName

func CreateGardenerClusterName() string

func DecodeJson

func DecodeJson(jsonConfig string, target interface{}) error

func Encode

func Encode(input interface{}, target *bytes.Buffer) error

func GardenerErrCodesToErrReason

func GardenerErrCodesToErrReason(lastErrors ...gardencorev1beta1.LastError) apperrors.ErrReason

func IsNilOrEmpty

func IsNilOrEmpty(str *string) bool

func K8SErrorToAppError

func K8SErrorToAppError(err error) apperrors.AppError

func NotNilOrEmpty

func NotNilOrEmpty(str *string) bool

func OkOrDefault

func OkOrDefault[T any](ptr *T, def *T) *T

OkOrDefault returns pointer or provided default pointer if pointer is nil

func PtrTo

func PtrTo[T any](v T) *T

PtrTo returns pointer to given value

func RemoveNotAllowedCharacters

func RemoveNotAllowedCharacters(str string) string

RemoveNotAllowedCharacters returns string containing only alphanumeric characters or hyphens

func RetryOnError

func RetryOnError(interval time.Duration, count int, errMsgFmt string, function func() apperrors.AppError) apperrors.AppError

func StartWithLetter

func StartWithLetter(str string) string

StartWithLetter returns given string but starting with letter

func UnwrapOrDefault

func UnwrapOrDefault[T any](ptr *T, def T) T

UnwrapOrDefault returns value from pointer or provided default value if pointer is nil

func UnwrapOrZero

func UnwrapOrZero[T any](ptr *T) T

UnwrapOrZero returns value from pointer or zero value if pointer is nil

Types

This section is empty.

Directories

Path Synopsis
k8s

Jump to

Keyboard shortcuts

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