1package handler
2
3import (
4 "net/http"
5
6 "git.gabrielgio.me/cerrado/pkg/service"
7 "git.gabrielgio.me/cerrado/templates"
8)
9
10type GitHandler struct {
11 gitService *service.GitService
12}
13
14func NewGitHandler(gitService *service.GitService) *GitHandler {
15 return &GitHandler{gitService}
16}
17
18func (g *GitHandler) List(w http.ResponseWriter, _ *http.Request) {
19 gitList := &templates.GitListPage{g.gitService.ListRepositories()}
20 templates.WritePageTemplate(w, gitList)
21}