Skip to content

Commit

Permalink
chore(deps): Migrating to pgx
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Sep 18, 2021
1 parent 6b663dc commit c92f465
Show file tree
Hide file tree
Showing 23 changed files with 1,776 additions and 1,176 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ style:
.PHONY: mocks
mocks:
find . -name "mocks" -type d -exec rm -r "{}" \+
mockgen -destination pkg/mocks/model.go -mock_names Mailer=Mailer,AuthService=AuthService,UserService=UserService,UserStore=UserStore,HelmProvider=HelmProvider,RepositoryService=RepositoryService,KetchupService=KetchupService -package mocks github.com/ViBiOh/ketchup/pkg/model Mailer,AuthService,UserService,UserStore,HelmProvider,RepositoryService,KetchupService
mockgen -destination pkg/mocks/model.go -mock_names Mailer=Mailer,AuthService=AuthService,UserService=UserService,UserStore=UserStore,HelmProvider=HelmProvider,RepositoryService=RepositoryService,RepositoryStore=RepositoryStore,KetchupService=KetchupService,Database=Database -package mocks github.com/ViBiOh/ketchup/pkg/model Mailer,AuthService,UserService,UserStore,HelmProvider,RepositoryService,RepositoryStore,KetchupService,Database
mockgen -destination pkg/mocks/pgx.go -mock_names Row=Row,Rows=Rows -package mocks github.com/jackc/pgx/v4 Row,Rows

## test: Shortcut to launch all the test tasks (unit, functional and integration).
.PHONY: test
Expand Down
6 changes: 1 addition & 5 deletions cmd/ketchup/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ func main() {

ketchupDb, err := db.New(dbConfig)
logger.Fatal(err)
defer func() {
if err := ketchupDb.Close(); err != nil {
logger.Error("error while closing database connection: %s", err)
}
}()
defer ketchupDb.Close()

redisApp := redis.New(redisConfig)

Expand Down
6 changes: 1 addition & 5 deletions cmd/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ func main() {

ketchupDb, err := db.New(dbConfig)
logger.Fatal(err)
defer func() {
if err := ketchupDb.Close(); err != nil {
logger.Error("error while closing database connection: %s", err)
}
}()
defer ketchupDb.Close()

mailerApp, err := mailer.New(mailerConfig)
logger.Fatal(err)
Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ module github.com/ViBiOh/ketchup
go 1.16

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/ViBiOh/auth/v2 v2.11.10
github.com/ViBiOh/httputils/v4 v4.23.1
github.com/ViBiOh/mailer v1.25.0
github.com/ViBiOh/auth/v2 v2.11.11
github.com/ViBiOh/httputils/v4 v4.24.1
github.com/ViBiOh/mailer v1.26.0
github.com/golang/mock v1.6.0
github.com/lib/pq v1.10.3
github.com/jackc/pgconn v1.10.0
github.com/jackc/pgproto3/v2 v2.1.1
github.com/jackc/pgx/v4 v4.13.0
github.com/prometheus/client_golang v1.11.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
162 changes: 147 additions & 15 deletions go.sum

Large diffs are not rendered by default.

293 changes: 292 additions & 1 deletion pkg/mocks/model.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c92f465

Please sign in to comment.