Help us shape the future of Go! Take the 2026 Go Developer Survey

fiberadapter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT, Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fiberadapter provides Fiber middleware for MPP-protected routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChargeMiddleware

func ChargeMiddleware(m *server.Mpp, params server.ChargeParams) fiberfw.Handler

ChargeMiddleware protects a Fiber route with the server charge flow.

func Credential

func Credential(c *fiberfw.Ctx) *mpp.Credential

Credential returns the verified credential stored on the Fiber context.

func Receipt

func Receipt(c *fiberfw.Ctx) *mpp.Receipt

Receipt returns the verified receipt stored on the Fiber context.

func WriteChallenge

func WriteChallenge(c *fiberfw.Ctx, challenge *mpp.Challenge, realm string)

WriteChallenge serializes a 402 challenge response using RFC 9457 problem details.

This is the Fiber equivalent of server.WriteChallenge. Fiber is built on fasthttp and cannot use http.ResponseWriter directly.

func WritePaymentError

func WritePaymentError(c *fiberfw.Ctx, err error)

WritePaymentError serializes MPP verification errors as problem details.

This is the Fiber equivalent of server.WritePaymentError. Fiber is built on fasthttp and cannot use http.ResponseWriter directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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