add http middleware, add option to use custom mux, improved logger kvs

This commit is contained in:
2021-10-13 17:05:59 +02:00
parent 2916a61b3b
commit 43357bc790
9 changed files with 72 additions and 15 deletions

15
service/mux.go Normal file
View File

@ -0,0 +1,15 @@
package service
import (
"net/http"
"github.com/justinas/alice"
)
type ServeMux interface {
ServeHTTP(http.ResponseWriter, *http.Request)
Handle(pattern string, handler http.Handler)
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}
type Middleware = alice.Constructor