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 ¶
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 ¶
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) 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.