From 142666ec6ab98836c809c48df34943d90d22f0ef Mon Sep 17 00:00:00 2001 From: Christopher Campbell Date: Mon, 24 Feb 2025 09:54:39 -0500 Subject: [PATCH] config name standards --- config/default.go | 2 +- db/config.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/default.go b/config/default.go index 4aa31af..b409ad1 100644 --- a/config/default.go +++ b/config/default.go @@ -35,7 +35,7 @@ Host = "cdk-data-availability-db" Port = "5432" EnableLog = false MaxConns = 200 -SslMode = "disable" +SSLMode = "disable" [RPC] Host = "0.0.0.0" diff --git a/db/config.go b/db/config.go index c632dee..698e591 100644 --- a/db/config.go +++ b/db/config.go @@ -32,14 +32,14 @@ type Config struct { // MaxConns is the maximum number of connections in the pool. MaxConns int `mapstructure:"MaxConns"` - // SslMode: "require", "verify-full", "verify-ca", and "disable" - SslMode string `mapstructure:"SslMode"` + // SSLMode: "require", "verify-full", "verify-ca", and "disable" + SSLMode string `mapstructure:"SSLMode"` } // InitContext initializes DB connection by the given config func InitContext(ctx context.Context, cfg Config) (*sqlx.DB, error) { psqlInfo := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s", - cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.Name, cfg.SslMode) + cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.Name, cfg.SSLMode) conn, err := sqlx.ConnectContext(ctx, "postgres", psqlInfo) if err != nil {