Documentation ¶
Index ¶
- Variables
- func ErrorClientMiddleware(ctx context.Context, req *fasthttp.Request, ...) (resp *fasthttp.Response, err error)
- func HeadersClientMiddleware(ctx context.Context, req *fasthttp.Request, ...) (resp *fasthttp.Response, err error)
- func HeadersServerMiddleware(ctx *fasthttp.RequestCtx, ...) (resp interface{}, err error)
- func LoggerClientMiddleware(ctx context.Context, req *fasthttp.Request, ...) (resp *fasthttp.Response, err error)
- func LoggerServerMiddleware(ctx *fasthttp.RequestCtx, ...) (resp interface{}, err error)
- func ResponseServerMiddleware(ctx *fasthttp.RequestCtx, ...) (resp interface{}, err error)
- func TimeoutClientMiddleware(ctx context.Context, req *fasthttp.Request, ...) (resp *fasthttp.Response, err error)
- func TimeoutServerMiddleware(ctx *fasthttp.RequestCtx, ...) (resp interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ClientMiddlewares = []func(ctx context.Context, req *fasthttp.Request, handler func(ctx context.Context, req *fasthttp.Request) (resp *fasthttp.Response, err error)) (resp *fasthttp.Response, err error){ LoggerClientMiddleware, HeadersClientMiddleware, ErrorClientMiddleware, TimeoutClientMiddleware, }
View Source
var ServerMiddlewares = []func(ctx *fasthttp.RequestCtx, handler func(ctx *fasthttp.RequestCtx) (resp interface{}, err error)) (resp interface{}, err error){ LoggerServerMiddleware, ResponseServerMiddleware, HeadersServerMiddleware, TimeoutServerMiddleware, }
Functions ¶
func ErrorClientMiddleware ¶
func ErrorClientMiddleware( ctx context.Context, req *fasthttp.Request, next func(ctx context.Context, req *fasthttp.Request) (resp *fasthttp.Response, err error), ) (resp *fasthttp.Response, err error)
ErrorClientMiddleware checks http response code for error
func HeadersClientMiddleware ¶
func HeadersClientMiddleware( ctx context.Context, req *fasthttp.Request, next func(ctx context.Context, req *fasthttp.Request) (resp *fasthttp.Response, err error), ) (resp *fasthttp.Response, err error)
HeadersClientMiddleware checks and sets headers for client
func HeadersServerMiddleware ¶
func HeadersServerMiddleware( ctx *fasthttp.RequestCtx, next func(ctx *fasthttp.RequestCtx) (resp interface{}, err error), ) (resp interface{}, err error)
HeadersServerMiddleware checks and sets headers for server
func LoggerClientMiddleware ¶
func LoggerClientMiddleware( ctx context.Context, req *fasthttp.Request, next func(ctx context.Context, req *fasthttp.Request) (resp *fasthttp.Response, err error), ) (resp *fasthttp.Response, err error)
LoggerClientMiddleware logs request and response for client
func LoggerServerMiddleware ¶
func LoggerServerMiddleware( ctx *fasthttp.RequestCtx, next func(ctx *fasthttp.RequestCtx) (resp interface{}, err error), ) (resp interface{}, err error)
LoggerServerMiddleware logs request and response for server
func ResponseServerMiddleware ¶
func ResponseServerMiddleware( ctx *fasthttp.RequestCtx, next func(ctx *fasthttp.RequestCtx) (resp interface{}, err error), ) (resp interface{}, err error)
ResponseServerMiddleware format response for server
func TimeoutClientMiddleware ¶
func TimeoutClientMiddleware( ctx context.Context, req *fasthttp.Request, next func(ctx context.Context, req *fasthttp.Request) (resp *fasthttp.Response, err error), ) (resp *fasthttp.Response, err error)
TimeoutClientMiddleware sets timeout for request
func TimeoutServerMiddleware ¶
func TimeoutServerMiddleware( ctx *fasthttp.RequestCtx, next func(ctx *fasthttp.RequestCtx) (resp interface{}, err error), ) (resp interface{}, err error)
TimeoutServerMiddleware sets timeout for request
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.