haproxy-lb/pkg/api/v1/server/handler.go
2021-02-10 23:54:31 +01:00

29 lines
549 B
Go

package server
import (
//"golang.org/x/crypto/bcrypt"
"net/http"
)
type notFoundHandler struct {
s *Server
}
func (nf *notFoundHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
newContext(w, r, nf.s).NotFound()
}
func authHandler(h ctxHandler) ctxHandler {
return func(ctx *Context) {
// TODO
// test:123456
// test:$2b$10$zNfGTAQ94vifj2wtGsv1W.yZRe4/rDBzQixpB6FbrTed4BnHuNqBS
//bcrypt.CompareHashAndPassword(hash, pw)
h(ctx)
}
}
func healthzHandler(ctx *Context) {
// TODO maybe report etcd/raft stats
ctx.OK()
}