From 4534dffb865eb1a50bfbc291a5c3798183081caf Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 May 2024 20:33:37 +0200 Subject: feat: Add actual git listing implementation --- main.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'main.go') 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) -- cgit v1.2.3