Documentation ¶
Index ¶
- func BasicAuth(username, password string) string
- func BasicAuthMiddleware(includePathPrefix, expectedUsername, expectedPassword string) func(next http.Handler) http.Handler
- func CreateLogger(logLevelTxt string) *zap.Logger
- func JSONAcceptRequest(impl func(writer http.ResponseWriter, request *http.Request)) func(http.ResponseWriter, *http.Request)
- func JSONContentTypeRequest(impl func(writer http.ResponseWriter, request *http.Request)) func(http.ResponseWriter, *http.Request)
- func PathParamRequest(expectedPathParams []string, ...) func(http.ResponseWriter, *http.Request)
- func WriteEntity(writer http.ResponseWriter, entity interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthMiddleware ¶ added in v1.3.0
func BasicAuthMiddleware(includePathPrefix, expectedUsername, expectedPassword string) func(next http.Handler) http.Handler
BasicAuthMiddleware checks whether the BasicAuth header of the request contains the expected username and password
func CreateLogger ¶ added in v1.3.0
CreateLogger creates a logger with the given log level
func JSONAcceptRequest ¶ added in v0.0.13
func JSONAcceptRequest(impl func(writer http.ResponseWriter, request *http.Request)) func(http.ResponseWriter, *http.Request)
JSONAcceptRequest checks whether the Accept header of the request is application/json
func JSONContentTypeRequest ¶ added in v0.0.13
func JSONContentTypeRequest(impl func(writer http.ResponseWriter, request *http.Request)) func(http.ResponseWriter, *http.Request)
JSONContentTypeRequest checks whether the Content-type header of the request is application/json
func PathParamRequest ¶ added in v0.0.13
func PathParamRequest(expectedPathParams []string, impl func(writer http.ResponseWriter, request *http.Request)) func(http.ResponseWriter, *http.Request)
PathParamRequest checks whether the request path contains expected path parameters
func WriteEntity ¶
func WriteEntity(writer http.ResponseWriter, entity interface{})
WriteEntity marshals an entity and writes the output to the http response
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.