diff options
author | GrailFinder <wohilas@gmail.com> | 2024-06-12 09:13:05 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2024-06-12 09:13:05 +0300 |
commit | b300ad869f424cdd26bcfc78635a27656836ca96 (patch) | |
tree | fc675c3608269d367be2ec23fd689f030bfaebd2 /internal/server/main.go | |
parent | 01f9a9f5d71450a0c80195058245fdebe88796bd (diff) |
Diffstat (limited to 'internal/server/main.go')
-rw-r--r-- | internal/server/main.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/server/main.go b/internal/server/main.go index 95d0369..1ab6cc2 100644 --- a/internal/server/main.go +++ b/internal/server/main.go @@ -2,6 +2,7 @@ package server import ( "apjournal/config" + "apjournal/internal/database/repos" "apjournal/internal/handlers" "context" @@ -9,8 +10,6 @@ import ( "os" "os/signal" "syscall" - - "github.com/jmoiron/sqlx" ) // Server interface @@ -41,9 +40,9 @@ func (srv *server) stopOnSignal(close context.CancelFunc) { os.Exit(0) } -func NewServer(cfg config.Config, log *slog.Logger, conn *sqlx.DB) Server { +func NewServer(cfg config.Config, log *slog.Logger, repo repos.FullRepo) Server { ctx, close := context.WithCancel(context.Background()) - actions := handlers.NewHandlers(cfg, log, conn) + actions := handlers.NewHandlers(cfg, log, repo) return &server{ config: cfg, actions: actions, |