util

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES_CTR_Decrypt

func AES_CTR_Decrypt(encryptedData []byte) ([]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) ([]byte, error)

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

func DecryptPlainTextPassword added in v1.1.1

func DecryptPlainTextPassword(username string) (string, error)

func IsConfigChanged

func IsConfigChanged(src, dest string) (bool, error)

IsConfigChanged reports whether src and dest config files are equal. Two config files are equal when they have the same file contents and Unix permissions. The owner, group, and mode must match. It return false in other cases.

func IsEnvVarSet added in v1.1.1

func IsEnvVarSet(key string) (string, error)

func IsFileExist

func IsFileExist(fpath string) bool

IsFileExist reports whether path exits.

func LogRequestSafely added in v1.1.1

func LogRequestSafely(logger *zap.SugaredLogger, operation string, data map[string]interface{})

LogRequestSafely logs request information with sensitive data masked

func ValidateAndSetAESKey

func ValidateAndSetAESKey() error

ValidateAndSetAESKey validates the AES key from environment variable and sets it for use This function should be called during application startup (e.g., in main.go) Returns error if key is missing or invalid

Types

type FileInfo

type FileInfo struct {
	Uid  uint32
	Gid  uint32
	Mode os.FileMode
	Md5  string
}

FileInfo describes a configuration file and is returned by fileStat.

func FileStat

func FileStat(name string) (fi FileInfo, err error)

Jump to

Keyboard shortcuts

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