Documentation ¶
Index ¶
Constants ¶
const ( PostgresHost = "host" PostgresPort = "port" PostgresDBName = "dbname" PostgresSslMode = "sslmode" PostgresDBUser = "user" PostgresPassword = "password" PostgresMaxOpenConn = "max_open_connections" PostgresMaxIdleConn = "max_idle_connections" )
postgres config params
const Pong = "PONG"
Variables ¶
var PostgresConfigParams = []string{ PostgresHost, PostgresPort, PostgresDBName, PostgresSslMode, PostgresDBUser, PostgresPassword, PostgresMaxOpenConn, PostgresMaxIdleConn, }
PostgresConfigParams : AVOID the use of same variable whenever using these constants. DON'T CHANGE THE BELOW ORDER as the parsing of GORM for line argument is not by key (yeah I know, very weird thing. TODO: test with change in order)
Functions ¶
func GetPgConn ¶
GetPgConn creates the database connection and the *gorm.Db object. It doesn't set the db logger. You would need to explicity set it using db.SetLogger(<logger>)
func GetRedisConn ¶
GetRedisConn returns the redis.Client object. It takes a parameter redisAddrKey which is the Redis env variable key stored on the os or AWS Parameter Store. This function will try to get the value of the input key from the os or Parameter Store and create the redisClient.
Types ¶
This section is empty.