diff options
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) |