aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/middleware.go
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2023-04-02 08:52:52 -0700
committerMax Resnick <max@ofmax.li>2023-05-26 09:47:59 -0700
commit480ce38f8c01de00adf6de651b8c2c57cd2148be (patch)
tree85bd66986cb3f0ad501549e46e649073775e8077 /internal/admin/middleware.go
parent9e04be2ca3d8980ebc8ec791d005ba77382fb1fa (diff)
downloadgo-git-server-480ce38f8c01de00adf6de651b8c2c57cd2148be.tar.gz
Adds a lot of tests adds middleware hook
Diffstat (limited to 'internal/admin/middleware.go')
-rw-r--r--internal/admin/middleware.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/admin/middleware.go b/internal/admin/middleware.go
new file mode 100644
index 0000000..56d4797
--- /dev/null
+++ b/internal/admin/middleware.go
@@ -0,0 +1,15 @@
+package admin
+
+import (
+ "log"
+ "net/http"
+)
+
+// Admin middleware to handle requests to the admin repo.
+func AdminHooks(adminSvc *Servicer, next http.Handler) http.Handler {
+ return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
+ log.Printf("stuffs about to reload %s", "now")
+ next.ServeHTTP(rw, req)
+ go adminSvc.Reload()
+ })
+}