some work done

This commit is contained in:
ston1th 2021-03-01 07:40:10 +01:00
commit 09fe1cd163
13 changed files with 174 additions and 45 deletions

View file

@ -3,18 +3,12 @@ package server
import (
//"golang.org/x/crypto/bcrypt"
"net/http"
"git.giftfish.de/ston1th/haproxy-lb/pkg/api/types"
)
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) {
func authHandler(h types.CtxHandler) types.CtxHandler {
return func(ctx *types.Context) {
// TODO
// test:123456
// test:$2b$10$zNfGTAQ94vifj2wtGsv1W.yZRe4/rDBzQixpB6FbrTed4BnHuNqBS
@ -23,7 +17,7 @@ func authHandler(h ctxHandler) ctxHandler {
}
}
func healthzHandler(ctx *Context) {
func healthzHandler(ctx *types.Context) {
// TODO maybe report etcd/raft stats
ctx.OK()
}