aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/incoming/web/handlers/repo
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-08-17 17:47:38 +0800
committerRunxi Yu <me@runxiyu.org>2025-08-17 18:04:34 +0800
commitf58f56701d047398cc8d7a6433719de1b6070242 (patch)
treeeddba41fc84549f8532af4da040cb227a0304f65 /forged/internal/incoming/web/handlers/repo
parentgofumpt (diff)
downloadforge-f58f56701d047398cc8d7a6433719de1b6070242.tar.gz
forge-f58f56701d047398cc8d7a6433719de1b6070242.tar.zst
forge-f58f56701d047398cc8d7a6433719de1b6070242.zip
Refactor handlers structure and add BaseData
Diffstat (limited to 'forged/internal/incoming/web/handlers/repo')
-rw-r--r--forged/internal/incoming/web/handlers/repo/index.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/forged/internal/incoming/web/handlers/repo/index.go b/forged/internal/incoming/web/handlers/repo/index.go
new file mode 100644
index 0000000..3a6d7ea
--- /dev/null
+++ b/forged/internal/incoming/web/handlers/repo/index.go
@@ -0,0 +1,20 @@
+package repo
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+
+ wtypes "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/types"
+)
+
+type HTTP struct{}
+
+func NewHTTP() *HTTP { return &HTTP{} }
+
+func (h *HTTP) Index(w http.ResponseWriter, r *http.Request, v wtypes.Vars) {
+ base := wtypes.Base(r)
+ repo := v["repo"]
+ _, _ = w.Write([]byte(fmt.Sprintf("repo index: group=%q repo=%q",
+ "/"+strings.Join(base.GroupPath, "/")+"/", repo)))
+}