utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AESSecretNameENVKey      = "AES_SECRET_NAME"
	AESSecretNamespaceENVKey = "NAMESPACE"
)

Variables

This section is empty.

Functions

func AES_CTR_Decrypt

func AES_CTR_Decrypt(encryptedData []byte, aesKey string) ([]byte, error)

AES_CTR_Decrypt decrypts base64 encoded string and returns plaintext (for backward compatibility)

func AES_CTR_Encrypt

func AES_CTR_Encrypt(plainText []byte, aesKey string) ([]byte, error)

AES_CTR_Encrypt encrypts plaintext and returns base64 encoded string (for backward compatibility)

func CompareInt32

func CompareInt32(name string, old, new int32, reqLogger logr.Logger) bool

func CompareIntPoint

func CompareIntPoint(name string, old, new *int, reqLogger logr.Logger) bool

func CompareStringValue

func CompareStringValue(name string, old, new string, reqLogger logr.Logger) bool

func Round

func Round(num float64) int

func SliceJoin

func SliceJoin(a []Stringer, sep string) string

SliceJoin concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string.

Types

type Decryptor added in v1.1.0

type Decryptor interface {
	Decrypt(context.Context, []byte) ([]byte, error)

	ValidateAesSecret(ctx context.Context) (string, error)
}

func NewSecretDecyptor added in v1.1.0

func NewSecretDecyptor(client client.Client, reqLogger logr.Logger) Decryptor

type SecretDecryptor added in v1.1.0

type SecretDecryptor struct {
	// contains filtered or unexported fields
}

func (*SecretDecryptor) Decrypt added in v1.1.0

func (d *SecretDecryptor) Decrypt(ctx context.Context, encryptedData []byte) ([]byte, error)

func (*SecretDecryptor) ValidateAesSecret added in v1.1.0

func (d *SecretDecryptor) ValidateAesSecret(ctx context.Context) (string, error)

type Stringer

type Stringer interface {
	String() string
}

Stringer implement the string interface

Jump to

Keyboard shortcuts

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