From 4a42a4465c8ff5496229f8883b9d1532bf7c9cab Mon Sep 17 00:00:00 2001 From: GrailFinder Date: Sun, 7 Apr 2024 09:53:04 +0300 Subject: Feat: db connection and migrations --- internal/server/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/server/main.go') diff --git a/internal/server/main.go b/internal/server/main.go index 45f3d41..95d0369 100644 --- a/internal/server/main.go +++ b/internal/server/main.go @@ -9,6 +9,8 @@ import ( "os" "os/signal" "syscall" + + "github.com/jmoiron/sqlx" ) // Server interface @@ -39,11 +41,9 @@ func (srv *server) stopOnSignal(close context.CancelFunc) { os.Exit(0) } -func NewServer(cfg config.Config, log *slog.Logger) Server { +func NewServer(cfg config.Config, log *slog.Logger, conn *sqlx.DB) Server { ctx, close := context.WithCancel(context.Background()) - // s := service.NewService(ctx, cfg, store.MemCache) - actions := handlers.NewHandlers(cfg, log) - + actions := handlers.NewHandlers(cfg, log, conn) return &server{ config: cfg, actions: actions, -- cgit v1.2.3