Documentation ¶
Index ¶
- Variables
- type HandlerInterceptor
- func (filter HandlerInterceptor) AfterCompletion(w http.ResponseWriter, r *http.Request, err any)
- func (filter HandlerInterceptor) PostHandle(w http.ResponseWriter, r *http.Request)
- func (filter HandlerInterceptor) PreHandle(w http.ResponseWriter, r *http.Request) error
- func (filter HandlerInterceptor) WrapHandle(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAfterCompletion = func(w http.ResponseWriter, r *http.Request, err any) { if err != nil { panic(err) } }
View Source
var DefaultPostHandler = func(w http.ResponseWriter, r *http.Request) {}
View Source
var DefaultPreHandler = func(w http.ResponseWriter, r *http.Request) error { return nil }
View Source
var DefaultWrapHandler = func(h http.Handler) http.Handler { return h }
Functions ¶
This section is empty.
Types ¶
type HandlerInterceptor ¶
type HandlerInterceptor struct { // Intercept the execution of a handler. // The default implementation returns true. // Parameters: // request - current HTTP request // response - current HTTP response // handler - chosen handler to execute, for type and/or instance evaluation // Returns: // true if the execution chain should proceed with the next interceptor or the handler itself. // Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself. PreHandleFunc func(w http.ResponseWriter, r *http.Request) error // Intercept the execution of a handler. // The default implementation is empty. // Parameters: // handler - current HTTP handler // Returns: // handler - wrapped HTTP handler WrapHandleFunc func(h http.Handler) http.Handler // Intercept the execution of a handler. // The default implementation is empty. // Parameters: // request - current HTTP request // response - current HTTP response // handler - the handler (or HandlerMethod) that started asynchronous execution, for type and/or instance examination PostHandleFunc func(w http.ResponseWriter, r *http.Request) // Callback after completion of request processing, that is, after rendering the view. // The default implementation is empty. // Parameters: // request - current HTTP request // response - current HTTP response // handler - the handler (or HandlerMethod) that started asynchronous execution, for type and/or instance examination // ex - any exception thrown on handler execution, if any; this does not include exceptions that have been handled through an exception resolver AfterCompletionFunc func(w http.ResponseWriter, r *http.Request, err any) }
func (HandlerInterceptor) AfterCompletion ¶
func (filter HandlerInterceptor) AfterCompletion(w http.ResponseWriter, r *http.Request, err any)
func (HandlerInterceptor) PostHandle ¶
func (filter HandlerInterceptor) PostHandle(w http.ResponseWriter, r *http.Request)
func (HandlerInterceptor) PreHandle ¶
func (filter HandlerInterceptor) PreHandle(w http.ResponseWriter, r *http.Request) error
func (HandlerInterceptor) WrapHandle ¶
func (filter HandlerInterceptor) WrapHandle(h http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.