From 349a3d1ff36a436261b1b65b870f8f262f06584f Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 26 May 2024 00:05:31 +0200 Subject: feat: Add bare bones project list --- pkg/handler/git.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkg/handler/git.go (limited to 'pkg/handler/git.go') diff --git a/pkg/handler/git.go b/pkg/handler/git.go new file mode 100644 index 0000000..5b09121 --- /dev/null +++ b/pkg/handler/git.go @@ -0,0 +1,21 @@ +package handler + +import ( + "net/http" + + "git.gabrielgio.me/cerrado/pkg/service" + "git.gabrielgio.me/cerrado/templates" +) + +type GitHandler struct { + gitService *service.GitService +} + +func NewGitHandler(gitService *service.GitService) *GitHandler { + return &GitHandler{gitService} +} + +func (g *GitHandler) List(w http.ResponseWriter, _ *http.Request) { + gitList := &templates.GitListPage{g.gitService.ListRepositories()} + templates.WritePageTemplate(w, gitList) +} -- cgit v1.2.3