Documentation
¶
Index ¶
- func BoolP(val bool) *booldeprecated
- func Dereference[T any](p *T) T
- func Int32P(val int32) *int32deprecated
- func Int64P(val int64) *int64deprecated
- func IntP(val int) *intdeprecated
- func IsValidEmail(email string) bool
- func PBool(ptr *bool) booldeprecated
- func PInt(ptr *int) intdeprecated
- func PInt32(ptr *int32) int32deprecated
- func PInt64(ptr *int64) int64deprecated
- func PString(ptr *string) stringdeprecated
- func Pointer[T any](v T) *T
- func StringP(val string) *stringdeprecated
- type IOEncryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dereference ¶
func Dereference[T any](p *T) T
Dereference returns the value of a pointer, or the zero value if the pointer is nil. Usage:
val := utils.Dereference(ptr) // returns value pointed by ptr, or zero value if ptr is nil
func IsValidEmail ¶
IsValidEmail returns true if the provided string is a valid email address format. Usage:
valid := utils.IsValidEmail("user@example.com") // returns true
valid := utils.IsValidEmail("not-an-email") // returns false
Types ¶
type IOEncryptor ¶
type IOEncryptor interface {
// Encrypt a given object
EncryptObject(o interface{}) (interface{}, error)
// Encrypt a given string message
EncryptString(message string) (string, error)
// Decrypt an existing encrypted object
DecryptObject(o interface{}) (interface{}, error)
// Decrypt an existing encrypted string
DecryptString(ciphermessage string) (string, error)
}
IOEncryptor is responsible for encrypting and decrypting objects while transacting with an IO ensuring capability of handling secret fields available as part of the data. while avoiding heavy usage of Vaults and HSM for High Transaction interfaces
func GetObjectEncryptor ¶
func GetObjectEncryptor(provider string) (IOEncryptor, error)
func InitializeEncryptor ¶
func InitializeEncryptor(provider, key string) (IOEncryptor, error)
InitializeEncryptor initialize a new Encryptor for given provider, this will return an error if encryptor already exists
Click to show internal directories.
Click to hide internal directories.