4 Commits 65b4387a0b ... 64ac7828bc

Author SHA1 Message Date
  Dima 64ac7828bc Merge remote-tracking branch 'origin/feature/mariadb' into feature/mariadb 3 days ago
  Dima c5490baffa Update app 3 days ago
  Dima 541ff11f8c Update app 3 days ago
  Dmitriy Gnatenko 98c8ac3f3f Update fiber app 3 days ago
7 changed files with 9 additions and 16 deletions
  1. 3 3
      Makefile
  2. 1 1
      cmd/app/main.go
  3. 3 1
      go.mod
  4. 2 2
      go.sum
  5. 0 1
      internal/service_provider/sp.go
  6. 0 7
      internal/services/config/config.go
  7. 0 1
      readme.md

+ 3 - 3
Makefile

@@ -21,12 +21,12 @@ lint:
 migration-status:
 migration-status:
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} status
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} status
 
 
-migration-up-one:
-	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up-by-one
-
 migration-up:
 migration-up:
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up
 
 
+migration-up-one:
+	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} up-by-one
+
 migration-down-one:
 migration-down-one:
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} down
 	goose -dir migrations ${DB_DRIVER} ${GOOSE_DB_STRING} down
 
 

+ 1 - 1
cmd/app/main.go

@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
 
 
-	_ "github.com/lib/pq"
+	_ "github.com/go-sql-driver/mysql"
 
 
 	"git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/fiber"
 	"git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/fiber"
 	sp "git.dmitriygnatenko.ru/dima/dmitriygnatenko-v2/internal/service_provider"
 	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
 go 1.22.2
 
 
 require (
 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/Masterminds/squirrel v1.5.3
 	github.com/brianvoe/gofakeit/v6 v6.28.0
 	github.com/brianvoe/gofakeit/v6 v6.28.0
 	github.com/go-playground/locales v0.14.0
 	github.com/go-playground/locales v0.14.0
 	github.com/go-playground/universal-translator v0.18.0
 	github.com/go-playground/universal-translator v0.18.0
 	github.com/go-playground/validator/v10 v10.11.1
 	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/fiber/v2 v2.52.5
 	github.com/gofiber/jwt/v3 v3.3.6
 	github.com/gofiber/jwt/v3 v3.3.6
 	github.com/gofiber/template/html/v2 v2.1.2
 	github.com/gofiber/template/html/v2 v2.1.2
@@ -21,6 +22,7 @@ require (
 )
 )
 
 
 require (
 require (
+	filippo.io/edwards25519 v1.1.0 // indirect
 	github.com/andybalholm/brotli v1.1.0 // indirect
 	github.com/andybalholm/brotli v1.1.0 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/fsnotify/fsnotify v1.6.0 // 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=
 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 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
 filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
 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/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/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/Masterminds/squirrel v1.5.3 h1:YPpoceAcxuzIljlr5iWpNKaql7hLeG1KLSrhvdHpkZc=
 github.com/Masterminds/squirrel v1.5.3 h1:YPpoceAcxuzIljlr5iWpNKaql7hLeG1KLSrhvdHpkZc=

+ 0 - 1
internal/service_provider/sp.go

@@ -58,7 +58,6 @@ func Init() (*ServiceProvider, error) {
 			db.WithMaxOpenConns(configService.DBMaxOpenConns()),
 			db.WithMaxOpenConns(configService.DBMaxOpenConns()),
 			db.WithMaxIdleConnLifetime(configService.DBMaxOpenConnLifetime()),
 			db.WithMaxIdleConnLifetime(configService.DBMaxOpenConnLifetime()),
 			db.WithMaxOpenConnLifetime(configService.DBMaxOpenConnLifetime()),
 			db.WithMaxOpenConnLifetime(configService.DBMaxOpenConnLifetime()),
-			db.WithSSLMode(configService.DBSSLMode()),
 		),
 		),
 	)
 	)
 
 

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

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

+ 0 - 1
readme.md

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