diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-17 18:14:35 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-08-17 18:14:35 +0800 |
commit | 4479525731ef41bd5e2a91b949142a2097e0e701 (patch) | |
tree | 1c19df11472fdd2202df7158dafd0b15f59c3521 /forged/internal/incoming/web/stub.go | |
parent | Move all config typedefs to config.go (diff) | |
download | forge-4479525731ef41bd5e2a91b949142a2097e0e701.tar.gz forge-4479525731ef41bd5e2a91b949142a2097e0e701.tar.zst forge-4479525731ef41bd5e2a91b949142a2097e0e701.zip |
Move more stub handlers to handlers/
Diffstat (limited to 'forged/internal/incoming/web/stub.go')
-rw-r--r-- | forged/internal/incoming/web/stub.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/forged/internal/incoming/web/stub.go b/forged/internal/incoming/web/stub.go deleted file mode 100644 index 4fffd73..0000000 --- a/forged/internal/incoming/web/stub.go +++ /dev/null @@ -1,38 +0,0 @@ -package web - -import ( - "fmt" - "net/http" - "strings" - - wtypes "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/types" -) - -func (h *handler) groupIndex(w http.ResponseWriter, r *http.Request, _ wtypes.Vars) { - base := wtypes.Base(r) - _, _ = w.Write([]byte("group index for: /" + strings.Join(base.GroupPath, "/") + "/")) -} - -func (h *handler) repoTree(w http.ResponseWriter, r *http.Request, v wtypes.Vars) { - base := wtypes.Base(r) - repo := v["repo"] - rest := v["rest"] // may be "" - if base.DirMode && rest != "" && !strings.HasSuffix(rest, "/") { - rest += "/" - } - _, _ = w.Write([]byte(fmt.Sprintf("tree: repo=%q path=%q", repo, rest))) -} - -func (h *handler) repoRaw(w http.ResponseWriter, r *http.Request, v wtypes.Vars) { - base := wtypes.Base(r) - repo := v["repo"] - rest := v["rest"] - if base.DirMode && rest != "" && !strings.HasSuffix(rest, "/") { - rest += "/" - } - _, _ = w.Write([]byte(fmt.Sprintf("raw: repo=%q path=%q", repo, rest))) -} - -func (h *handler) notImplemented(w http.ResponseWriter, _ *http.Request, _ wtypes.Vars) { - http.Error(w, "not implemented", http.StatusNotImplemented) -} |