Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotAuthenticated = httperrors.NewUnauthorizedError("Authentification Error", "not authenticated")
)
Functions ¶
This section is empty.
Types ¶
type AuthenticationMiddleware ¶
The authentication middleware
func NewAuthenticationMiddleware ¶
func NewAuthenticationMiddleware(sessionService sessionservice.SessionService, logger *zap.Logger) AuthenticationMiddleware
The AuthenticationMiddleware constructor
type JSONController ¶
type JSONController interface { // Marshall the response from the JSONHandler and handle HTTPError if needed Wrap(handler JSONHandler) func(response http.ResponseWriter, request *http.Request) }
transform a JSON handler into a standard http.HandlerFunc handle github.com/ditrit/badaas/httperrors.HTTPError and JSON marshaling
func NewJSONController ¶
func NewJSONController(logger *zap.Logger) JSONController
type JSONHandler ¶
type JSONHandler func(w http.ResponseWriter, r *http.Request) (any, httperrors.HTTPError)
This handler return a Marshable object and/or an github.com/ditrit/badaas/services/httperrors.HTTPError
type MiddlewareLogger ¶
type MiddlewareLogger interface { // [github.com/gorilla/mux] compatible middleware function Handle(next http.Handler) http.Handler }
Log the requests data
func NewMiddlewareLogger ¶
func NewMiddlewareLogger( logger *zap.Logger, loggerConfiguration configuration.LoggerConfiguration, ) (MiddlewareLogger, error)
MiddlewareLogger constructor
Click to show internal directories.
Click to hide internal directories.