websubecho

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package websubecho mounts websub handlers on an echo router.

The three websub types are ordinary net/http.Handler values, so this adapter is one call to echo's own wrapper. There is no protocol logic here, and there should never be any.

sub, err := websub.NewSubscriber("https://example.com/websub/")
e := echo.New()
e.Any("/websub/*", websubecho.Handler(sub))

Note the wildcard. Each subscription gets its own callback below the URL the subscriber was built with, so the route must match a prefix rather than one exact path. A hub serves a single URL and needs no wildcard:

e.POST("/hub", websubecho.Handler(hub))

A publisher advertises its hub through response headers rather than serving a route of its own, so wrap whatever already serves the topic:

e.GET("/feed", websubecho.Handler(publisher.Middleware("/feed", feed)))

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(h http.Handler) echo.HandlerFunc

Handler adapts a websub handler, meaning a websub.Subscriber, websub.Publisher middleware, or websub.Hub, for use as an echo.HandlerFunc.

Types

This section is empty.

Jump to

Keyboard shortcuts

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