Documentation ¶
Index ¶
- func AssignArrayPropertyFromString(st interface{}, field string, arrString string, delimiter string) error
- func CheckAndRetry(checkerFunc func() error, maxTries int, secondsToWait int, debug bool) (err error)
- func CheckDBConnection(dbConn *sql.DB, maxTries int, secondsToWait int, debug bool) error
- func CheckRedisConnection(redisClient *redis.Client, maxTries int, secondsToWait int, debug bool) error
- func CheckRequiredPostgresEnvs(envVarPrefix string)
- func CheckRequiredRedisEnvs(envVarPrefix string, useTLS bool)
- func CheckStructFieldsForInjection(st interface{}) error
- func InitPostgres(envVarPrefix string, debug bool) (dbConn *sql.DB)
- func InitPostgresMigrations(dbConn *sql.DB, maxMsToWait int, isRunningLocally bool, debug bool)
- func InitRedis(envVarPrefix string, useTLS bool, debug bool) (redisClient *redis.Client)
- func ValidateDBConnOrPanic(dbConn *sql.DB, debug bool)
- func ValidateRedisConnOrPanic(redisClient *redis.Client, debug bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignArrayPropertyFromString ¶
func AssignArrayPropertyFromString(st interface{}, field string, arrString string, delimiter string) error
Function mostly from https://coderedirect.com/questions/432349/golang-dynamic-access-to-a-struct-property A function that splits a string based on a delimiter and assigns it to a slice in a struct's field Ex: a struct 's' with field 'MyArr', and string "val1::val2::val3"
This function will assign ["val1", "val2", "val3"] into s.MyArr
func CheckAndRetry ¶
func CheckDBConnection ¶
func CheckRedisConnection ¶
func CheckRequiredPostgresEnvs ¶
func CheckRequiredPostgresEnvs(envVarPrefix string)
func CheckRequiredRedisEnvs ¶
func CheckStructFieldsForInjection ¶
func CheckStructFieldsForInjection(st interface{}) error
Generally this function isn't necessary because we use prepared statements, but more safety is good
func InitPostgresMigrations ¶
func ValidateDBConnOrPanic ¶
func ValidateRedisConnOrPanic ¶
func ValidateRedisConnOrPanic(redisClient *redis.Client, debug bool)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.