handler

package
v0.0.0-...-9149657 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles incoming HTTP requests.

func NewHandler

func NewHandler(storage storage.WebhookStorage, options ...Option) *Handler

NewHandler creates and initializes handler.

func (*Handler) HomeHandler

func (h *Handler) HomeHandler(w http.ResponseWriter, r *http.Request)

HomeHandler renders the landing page.

func (*Handler) HookHandler

func (h *Handler) HookHandler(w http.ResponseWriter, r *http.Request)

HookHandler accepts incoming webhook deliveries on /hooks/{id}[/*].

func (*Handler) MessageHandler

func (h *Handler) MessageHandler(w http.ResponseWriter, r *http.Request)

MessageHandler handles requests for the captured-messages endpoint.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

Register attaches all API, ingest, and UI routes to the provided mux.

func (*Handler) UnknownHandler

func (h *Handler) UnknownHandler(w http.ResponseWriter, r *http.Request)

UnknownHandler handles requests for unknown endpoints and returns 404

func (*Handler) WebhookHandler

func (h *Handler) WebhookHandler(w http.ResponseWriter, r *http.Request)

WebhookHandler handles request for webhook endpoint. POST creates a new webhook.

func (*Handler) WebhookPageHandler

func (h *Handler) WebhookPageHandler(w http.ResponseWriter, r *http.Request)

WebhookPageHandler renders a detail page for a single webhook.

func (*Handler) WebhooksPageHandler

func (h *Handler) WebhooksPageHandler(w http.ResponseWriter, r *http.Request)

WebhooksPageHandler handles the HTML form for creating webhooks.

type Option

type Option func(*Handler)

Option configures a handler.

func WithClientIPHeader

func WithClientIPHeader(headerName string) Option

WithClientIPHeader configures an optional request header that contains the client IP.

func WithPublicBaseURL

func WithPublicBaseURL(baseURL string) Option

WithPublicBaseURL sets the absolute base URL returned in webhook capability URLs.

func WithRateLimit

func WithRateLimit(limit int, window time.Duration) Option

WithRateLimit overrides the default per-IP request limit.

Jump to

Keyboard shortcuts

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