Initial commit
This commit is contained in:
28
keys/init.go
Normal file
28
keys/init.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package keys
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func InitHttpHandlers() {
|
||||
http.HandleFunc("/ssh/", sshKey)
|
||||
http.HandleFunc("/age/", ageKey)
|
||||
http.HandleFunc("/gpg/", gpgKey)
|
||||
http.HandleFunc("/gpg/koumbit/", gpgKey)
|
||||
}
|
||||
|
||||
func sshKey(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
_, _ = io.WriteString(w, SSH_KEY)
|
||||
}
|
||||
|
||||
func ageKey(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
_, _ = io.WriteString(w, AGE_KEY)
|
||||
}
|
||||
|
||||
func gpgKey(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
_, _ = io.WriteString(w, GPG_KEY)
|
||||
}
|
Reference in New Issue
Block a user