Dima 3 dias atrás
pai
commit
541ff11f8c
5 arquivos alterados com 6 adições e 12 exclusões
  1. 1 1
      cmd/app/main.go
  2. 3 1
      go.mod
  3. 2 2
      go.sum
  4. 0 7
      internal/services/config/config.go
  5. 0 1
      readme.md

+ 1 - 1
cmd/app/main.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"log"
 
-	_ "github.com/lib/pq"
+	_ "github.com/go-sql-driver/mysql"
 
 	"git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/fiber"
 	sp "git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/service_provider"

+ 3 - 1
go.mod

@@ -3,12 +3,13 @@ module git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2
 go 1.22.2
 
 require (
-	git.dmitriygnatenko.ru/dima/go-common v1.6.2
+	git.dmitriygnatenko.ru/dima/go-common v1.6.3
 	github.com/Masterminds/squirrel v1.5.3
 	github.com/brianvoe/gofakeit/v6 v6.28.0
 	github.com/go-playground/locales v0.14.0
 	github.com/go-playground/universal-translator v0.18.0
 	github.com/go-playground/validator/v10 v10.11.1
+	github.com/go-sql-driver/mysql v1.8.1
 	github.com/gofiber/fiber/v2 v2.52.5
 	github.com/gofiber/jwt/v3 v3.3.6
 	github.com/gofiber/template/html/v2 v2.1.2
@@ -21,6 +22,7 @@ require (
 )
 
 require (
+	filippo.io/edwards25519 v1.1.0 // indirect
 	github.com/andybalholm/brotli v1.1.0 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/fsnotify/fsnotify v1.6.0 // indirect

+ 2 - 2
go.sum

@@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
 filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
-git.dmitriygnatenko.ru/dima/go-common v1.6.2 h1:AMipagbqaU5VDa9w1alHToy+7Bp4PPMkbui9yWgOqTc=
-git.dmitriygnatenko.ru/dima/go-common v1.6.2/go.mod h1:/7VcyxInOlvAGedhH8YONNpWWETaXFU8gnTxLDLcing=
+git.dmitriygnatenko.ru/dima/go-common v1.6.3 h1:TcRZOyV3SG6yGRG5b/aNJ3sySF9ti3w0eHMvImMup4s=
+git.dmitriygnatenko.ru/dima/go-common v1.6.3/go.mod h1:/7VcyxInOlvAGedhH8YONNpWWETaXFU8gnTxLDLcing=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/Masterminds/squirrel v1.5.3 h1:YPpoceAcxuzIljlr5iWpNKaql7hLeG1KLSrhvdHpkZc=

+ 0 - 7
internal/services/config/config.go

@@ -19,7 +19,6 @@ type Service struct {
 	dbName                      string
 	dbUser                      string
 	dbPassword                  string
-	dbSSLMode                   string
 	dbMaxOpenConns              uint16
 	dbMaxIdleConns              uint16
 	dbMaxOpenConnLifetime       time.Duration
@@ -75,7 +74,6 @@ func Init() (*Service, error) {
 		DBName                      string        `mapstructure:"DB_NAME"`
 		DBUser                      string        `mapstructure:"DB_USER"`
 		DBPassword                  string        `mapstructure:"DB_PASSWORD"`
-		DBSSLMode                   string        `mapstructure:"DB_SSL_MODE"`
 		DBMaxOpenConns              uint16        `mapstructure:"DB_MAX_OPEN_CONNS"`
 		DBMaxIdleConns              uint16        `mapstructure:"DB_MAX_IDLE_CONNS"`
 		DBMaxOpenConnLifetime       time.Duration `mapstructure:"DB_MAX_OPEN_CONN_LIFETIME"`
@@ -118,7 +116,6 @@ func Init() (*Service, error) {
 		dbName:                      s.DBName,
 		dbUser:                      s.DBUser,
 		dbPassword:                  s.DBPassword,
-		dbSSLMode:                   s.DBSSLMode,
 		dbMaxOpenConns:              s.DBMaxOpenConns,
 		dbMaxIdleConns:              s.DBMaxIdleConns,
 		dbMaxOpenConnLifetime:       s.DBMaxOpenConnLifetime,
@@ -184,10 +181,6 @@ func (s Service) DBPassword() string {
 	return s.dbPassword
 }
 
-func (s Service) DBSSLMode() string {
-	return s.dbSSLMode
-}
-
 func (s Service) DBMaxOpenConns() uint16 {
 	return s.dbMaxOpenConns
 }

+ 0 - 1
readme.md

@@ -17,7 +17,6 @@ DB_PORT=1111
 DB_NAME=db
 DB_USER=user
 DB_PASSWORD=pass
-DB_SSL_MODE=disable
 DB_MAX_OPEN_CONNS=0
 DB_MAX_IDLE_CONNS=0
 DB_MAX_OPEN_CONN_LIFETIME=0s