aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-26 20:33:37 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-26 20:33:37 +0200
commit4534dffb865eb1a50bfbc291a5c3798183081caf (patch)
treed5bd1a2d9912a6442e3be1511ffb1d99f12287b0 /main.go
parent349a3d1ff36a436261b1b65b870f8f262f06584f (diff)
downloadcerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.tar.gz
cerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.tar.bz2
cerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.zip
feat: Add actual git listing implementation
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/main.go b/main.go
index 0ba2dbc..644b96c 100644
--- a/main.go
+++ b/main.go
@@ -9,6 +9,8 @@ import (
"os/signal"
"time"
+ "git.gabrielgio.me/cerrado/pkg/config"
+ "git.gabrielgio.me/cerrado/pkg/git"
"git.gabrielgio.me/cerrado/pkg/handler"
"git.gabrielgio.me/cerrado/pkg/service"
"git.gabrielgio.me/cerrado/pkg/worker"
@@ -38,8 +40,21 @@ func run(ctx context.Context) error {
return err
}
+ f, err := os.Open(*configPath)
+ if err != nil {
+ return err
+ }
+
+ config, err := config.Parse(f)
+ if err != nil {
+ return err
+ }
+
+ // repositories
+ gitServer := git.NewGitServerRepository(config.Scan.Path)
+
// services
- gitService := service.NewGitService()
+ gitService := service.NewGitService(gitServer)
//handlers
gitHandler := handler.NewGitHandler(gitService)