internal

package
v1.2.78 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAfterCompletion = func(w http.ResponseWriter, r *http.Request, err interface{}) {
	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 interface{})
}

func (HandlerInterceptor) AfterCompletion

func (filter HandlerInterceptor) AfterCompletion(w http.ResponseWriter, r *http.Request, err interface{})

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL