middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestKey    = requestKey{}
	ResponseKey   = responseKey{}
	GinContextKey = ginContextKey{}
)

Functions

func CreateHandlerFunc

func CreateHandlerFunc(method interface{}) gin.HandlerFunc

func CreateRouteHandlerFunc

func CreateRouteHandlerFunc(method interface{}) gin.HandlerFunc

func ExtractGinContextWithCtx

func ExtractGinContextWithCtx(ctx context.Context) (*gin.Context, error)

func ExtractRequestWithCtx

func ExtractRequestWithCtx(ctx context.Context) (*http.Request, error)

func ExtractResponseWithCtx

func ExtractResponseWithCtx(ctx context.Context) (*http.Response, error)

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (Context) GetContext

func (c Context) GetContext() *gin.Context

type Middleware

type Middleware = gin.HandlerFunc

func LoggingRequest

func LoggingRequest() Middleware

func LoggingRequestWithLogger

func LoggingRequestWithLogger(l *logger.Logger, simply bool) Middleware

func LoggingResponse

func LoggingResponse() Middleware

func LoggingResponseWithLogger

func LoggingResponseWithLogger(l *logger.Logger, simply bool) Middleware

func LoggingSimplyRequest

func LoggingSimplyRequest() Middleware

func LoggingSimplyResponse

func LoggingSimplyResponse() Middleware

func Recovery

func Recovery() Middleware

Recovery global exception handling middleware

func RecoveryCustom

func RecoveryCustom(recover Middleware) Middleware

Jump to

Keyboard shortcuts

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