summaryrefslogtreecommitdiff
path: root/pkg/web/handlers.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-01-24 21:19:19 -0600
committerkali kaneko (leap communications) <kali@leap.se>2020-01-24 21:20:50 -0600
commitd437b73a8c2dda9884c92d2be44727e66c2289e2 (patch)
treeb9936d4e12a14b76d88ba1464a765e5b05ca6159 /pkg/web/handlers.go
parent12f0aca04bb613cae64d3c438042b85474abb411 (diff)
refactor into cmd/pkg
Diffstat (limited to 'pkg/web/handlers.go')
-rw-r--r--pkg/web/handlers.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/web/handlers.go b/pkg/web/handlers.go
new file mode 100644
index 0000000..c4f2e9a
--- /dev/null
+++ b/pkg/web/handlers.go
@@ -0,0 +1,19 @@
+package web
+
+import (
+ "net/http"
+)
+
+type CertHandler struct {
+ Cainfo caInfo
+}
+
+func (ch *CertHandler) CertResponder(w http.ResponseWriter, r *http.Request) {
+ ch.Cainfo.CertWriter(w)
+}
+
+func HttpFileHandler(route string, path string) {
+ http.HandleFunc(route, func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, path)
+ })
+}