summaryrefslogtreecommitdiff
path: root/internal/server/main.go
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-06-12 09:13:05 +0300
committerGrailFinder <wohilas@gmail.com>2024-06-12 09:13:05 +0300
commitb300ad869f424cdd26bcfc78635a27656836ca96 (patch)
treefc675c3608269d367be2ec23fd689f030bfaebd2 /internal/server/main.go
parent01f9a9f5d71450a0c80195058245fdebe88796bd (diff)
Feat: add cron and defaults tableHEADmaster
Diffstat (limited to 'internal/server/main.go')
-rw-r--r--internal/server/main.go7
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,