diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 20:33:37 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 20:33:37 +0200 |
commit | 4534dffb865eb1a50bfbc291a5c3798183081caf (patch) | |
tree | d5bd1a2d9912a6442e3be1511ffb1d99f12287b0 /main.go | |
parent | 349a3d1ff36a436261b1b65b870f8f262f06584f (diff) | |
download | cerrado-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.go | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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) |