summaryrefslogtreecommitdiff
path: root/pkg/web/handlers.go
diff options
context:
space:
mode:
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)
+ })
+}