diff options
author | GrailFinder <wohilas@gmail.com> | 2024-04-07 09:53:04 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2024-04-07 09:53:04 +0300 |
commit | 4a42a4465c8ff5496229f8883b9d1532bf7c9cab (patch) | |
tree | e0cbccdfe6a770cbbdecee2e2176ee697997229e /internal/server/main.go | |
parent | b662265234d70d648a7adce74f3d9cc245456d3a (diff) |
Feat: db connection and migrations
Diffstat (limited to 'internal/server/main.go')
-rw-r--r-- | internal/server/main.go | 8 |
1 files changed, 4 insertions, 4 deletions
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, |