webhookwire

package
v1.147.0 Latest Latest
Warning

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

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

Documentation

Overview

Package webhookwire assembles inbound webhooks for the HTTP composition root (#1870): the source store, the receiver mounted at /hooks/, the compactor, and the source service the admin API calls.

Everything a source writes lands in the managed-resources bucket, through a client on the managed-resources S3 connection, because the scratch catalog that reads a source's compacted windows -- which are managed resources -- has to read its raw segments as well. A deployment with no database, no managed resources store or no Trino toolkit has no webhooks.

Index

Constants

View Source
const EnvAlertInterval = "MCP_PLATFORM_WEBHOOK_ALERT_INTERVAL"

EnvAlertInterval overrides how often the webhook alerts are evaluated (default a minute), as a Go duration.

Variables

This section is empty.

Functions

This section is empty.

Types

type Webhooks

type Webhooks struct {
	// Service manages sources; the admin API mounts it.
	Service *whadmin.Service
	// contains filtered or unexported fields
}

Webhooks is the assembled feature. A nil *Webhooks is a deployment without webhooks, and every method on it does nothing.

func Build

func Build(p *platform.Platform, address string, exec whtable.Executor) (*Webhooks, error)

Build assembles webhooks from the platform. address is the main listener's, which names this replica. It returns nil when the deployment cannot hold a webhook source, and an error when the receiver's spool is configured and cannot be opened: an operator who asked for acknowledged events to be kept on disk is told at start, not answered without it.

func (*Webhooks) EnableAlerts added in v1.147.0

func (w *Webhooks) EnableAlerts(sender levelalert.Sender, base string)

EnableAlerts builds the webhook alert evaluation (#2149), posting through sender and linking to the portal under base. Called before Start; a nil Webhooks does nothing.

func (*Webhooks) Mount

func (w *Webhooks) Mount(mux *http.ServeMux)

Mount serves /hooks/ on mux when this replica receives.

func (*Webhooks) MountAdmin added in v1.146.0

func (w *Webhooks) MountAdmin(
	mux *http.ServeMux, p *platform.Platform,
	auth func(*platform.Platform) func(http.Handler) http.Handler, author func(*http.Request) string,
)

MountAdmin registers the webhook source routes behind the admin API's authentication, when there are webhooks and the admin API is enabled.

func (*Webhooks) Start

func (w *Webhooks) Start(ctx context.Context)

Start begins receiving, compacting, and serving the receiver's own listener when one is configured.

func (*Webhooks) Stop

func (w *Webhooks) Stop()

Stop ends the listener, answers every request waiting on a segment, and stops the compactor.

Jump to

Keyboard shortcuts

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