Documentation
¶
Index ¶
- func BoolP(val bool) *bool
- func Int32P(val int32) *int32
- func Int64P(val int64) *int64
- func IntP(val int) *int
- func IsValidEmail(email string) bool
- func PBool(ptr *bool) bool
- func PInt(ptr *int) int
- func PInt32(ptr *int32) int32
- func PInt64(ptr *int64) int64
- func PString(ptr *string) string
- func StringP(val string) *string
- type IOEncryptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolP ¶
BoolP returns a pointer to the given bool value. Usage:
ptr := utils.BoolP(true) // *bool pointing to true
func Int32P ¶
Int32P returns a pointer to the given int32 value. Usage:
ptr := utils.Int32P(42) // *int32 pointing to 42
func Int64P ¶
Int64P returns a pointer to the given int64 value. Usage:
ptr := utils.Int64P(42) // *int64 pointing to 42
func IntP ¶
IntP returns a pointer to the given int value. Usage:
ptr := utils.IntP(42) // *int pointing to 42
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
func PBool ¶
PBool returns the value of a *bool pointer, or false if the pointer is nil. Usage:
val := utils.PBool(ptr) // returns value pointed by ptr, or false if ptr is nil
func PInt ¶
PInt returns the value of a *int pointer, or 0 if the pointer is nil. Usage:
val := utils.PInt(ptr) // returns value pointed by ptr, or 0 if ptr is nil
func PInt32 ¶
PInt32 returns the value of a *int32 pointer, or 0 if the pointer is nil. Usage:
val := utils.PInt32(ptr) // returns value pointed by ptr, or 0 if ptr is nil
func PInt64 ¶
PInt64 returns the value of a *int64 pointer, or 0 if the pointer is nil. Usage:
val := utils.PInt64(ptr) // returns value pointed by ptr, or 0 if ptr is nil
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