util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object) error

CreateOrUpdate creates or updates the client.object

func DecodeBase64Byte added in v0.2.0

func DecodeBase64Byte(value []byte) ([]byte, error)

func Encode

func Encode(value []byte) []byte

Encode queues message

func GenerateRandomStr

func GenerateRandomStr(length int) string

GenerateRandomStr - generate random string for given length

func GenerateSecretAccessKey

func GenerateSecretAccessKey() (string, error)

GenerateSecretAccessKey - generate random base64 numeric value from a random seed.

func GetSecurityValueByKey added in v0.2.0

func GetSecurityValueByKey(secret *corev1.Secret, key string) (string, error)

GetSecurityValueByKey get security value from secret by key

func RemoveSpecialCharacter

func RemoveSpecialCharacter(str string) string

RemoveSpecialCharacter - remove special character

func UpdateStatus

func UpdateStatus(ctx context.Context, reconcilier client.Client, instance client.Object) error

UpdateStatus updates the status of the Server resource https://stackoverflow.com/questions/76388004/k8s-controller-update-status-and-condition

Types

type Base64 added in v0.4.0

type Base64[T []byte | string] struct {
	Data T
}

func (Base64[T]) Decode added in v0.4.0

func (b Base64[T]) Decode() (T, error)

func (Base64[T]) Encode added in v0.4.0

func (b Base64[T]) Encode() T

Jump to

Keyboard shortcuts

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