adaptor

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 13 Imported by: 43

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRemoteAddrEmpty   = errors.New("remote address cannot be empty")
	ErrRemoteAddrTooLong = errors.New("remote address too long")
)

Functions

func ConvertRequest

func ConvertRequest(c fiber.Ctx, forServer bool) (*http.Request, error)

ConvertRequest converts a fiber.Ctx to a http.Request. forServer should be set to true when the http.Request is going to be passed to a http.Handler.

func CopyContextToFiberContext deprecated

func CopyContextToFiberContext(src any, requestContext *fasthttp.RequestCtx)

CopyContextToFiberContext copies the values of context.Context to a fasthttp.RequestCtx. This function safely handles struct fields, using unsafe operations only when necessary for unexported fields.

Deprecated: This function uses reflection and unsafe pointers; consider using explicit context passing.

func FiberApp

func FiberApp(app *fiber.App) http.HandlerFunc

FiberApp wraps fiber app to net/http handler func

func FiberHandler

func FiberHandler(h fiber.Handler) http.Handler

FiberHandler wraps fiber handler to net/http handler

func FiberHandlerFunc

func FiberHandlerFunc(h fiber.Handler) http.HandlerFunc

FiberHandlerFunc wraps fiber handler to net/http handler func

func HTTPHandler

func HTTPHandler(h http.Handler) fiber.Handler

HTTPHandler wraps net/http handler to fiber handler

func HTTPHandlerFunc

func HTTPHandlerFunc(h http.HandlerFunc) fiber.Handler

HTTPHandlerFunc wraps net/http handler func to fiber handler

func HTTPHandlerWithContext

func HTTPHandlerWithContext(h http.Handler) fiber.Handler

HTTPHandlerWithContext is like HTTPHandler, but additionally stores Fiber’s user context in the request context

func HTTPMiddleware

func HTTPMiddleware(mw func(http.Handler) http.Handler) fiber.Handler

HTTPMiddleware wraps net/http middleware to fiber middleware

func LocalContextFromHTTPRequest

func LocalContextFromHTTPRequest(r *http.Request) (context.Context, bool)

LocalContextFromHTTPRequest extracts the Fiber user context previously stored into r.Context() by the adaptor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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