webhooks

package
v0.0.0-...-9914b64 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 i/webhooks/* endpoints.

func NewHandler

func NewHandler(repo repository.WebhookRepository, idGen id.Generator, rolePolicyProvider role.PolicyProvider) *Handler

NewHandler creates a new webhooks handler. rolePolicyProvider is the role policy source Create uses to enforce the `webhookLimit` role policy (#1029).

func (*Handler) Create

func (h *Handler) Create(c *echo.Context) error

Create handles POST /api/i/webhooks/create.

func (*Handler) Delete

func (h *Handler) Delete(c *echo.Context) error

Delete handles POST /api/i/webhooks/delete.

func (*Handler) List

func (h *Handler) List(c *echo.Context) error

List handles POST /api/i/webhooks/list.

func (*Handler) SetDispatcher

func (h *Handler) SetDispatcher(d TestDispatcher)

SetDispatcher wires a TestDispatcher so that /api/i/webhooks/test can fire a synthetic test payload through the production pipeline.

func (*Handler) Show

func (h *Handler) Show(c *echo.Context) error

Show handles POST /api/i/webhooks/show.

func (*Handler) Test

func (h *Handler) Test(c *echo.Context) error

Test handles POST /api/i/webhooks/test. 本家互換: req.type で指定されたイベント種別のテストペイロードを dispatcher に渡し、通常の配信パイプラインを通して登録済み webhook に送信する。

upstream Misskey TS の paramDef は webhookId + type を required + type に webhookEventTypes enum check を強制している (packages/backend/src/.../i/ webhooks/test.ts、#937)。

func (*Handler) Update

func (h *Handler) Update(c *echo.Context) error

Update handles POST /api/i/webhooks/update.

type TestDispatcher

type TestDispatcher interface {
	DispatchUserTest(webhookID, userID, eventType string, body any, overrideURL, overrideSecret string)
}

TestDispatcher is the minimal interface the Test endpoint uses to enqueue a synthetic webhook payload. 循環依存を避けるため interface で受ける (実装は core/webhook.Service 経由)。DispatchUserTest は指定 webhook 1 件だけに 送り、overrideURL/Secret 非空時は保存済 webhook でなくそちらへ送る (#1546)。

Jump to

Keyboard shortcuts

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