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

echoadapter

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package echoadapter provides Echo 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) echofw.MiddlewareFunc

ChargeMiddleware protects an Echo route with the server charge flow. It runs server.Mpp.ChargeRequest with the route's scope (its Path) unless params.MppxScope is set, writes the payment response when payment is required or rejected, and on success stores the verified Credential and Receipt on the Echo context and the request context.

func ComposeMiddleware added in v0.6.0

func ComposeMiddleware(offers ...server.Offer) echofw.MiddlewareFunc

ComposeMiddleware protects an Echo route with several payment offers, like server.ComposeMiddleware: an unpaid request gets every offer, and a Credential is verified against the offer it echoes. Offers without their own Params.MppxScope bind the route's scope. ComposeMiddleware panics when server.ComposeMiddleware would: offers is empty, an Mpp is nil, realms differ, or an offer cannot be built.

func Credential

func Credential(c echofw.Context) *mpp.Credential

Credential returns the verified credential stored on the Echo context.

func Receipt

func Receipt(c echofw.Context) *mpp.Receipt

Receipt returns the verified receipt stored on the Echo context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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