webhook

package
v1.1.67 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package webhook implements inbound webhook routing for serve channels. External services (GitHub, CI, etc.) POST events to /webhook/<path>, which are verified and dispatched to agent tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	HandleWebhookEvent(ctx context.Context, route RouteConfig, payload []byte) error
}

Handler processes incoming webhook events.

type RouteConfig

type RouteConfig struct {
	Path           string   `json:"path"`
	Events         []string `json:"events"`
	Skill          string   `json:"skill"`
	Delivery       string   `json:"delivery"`                  // "wechat", "feishu", or "" (no delivery)
	DeliveryTarget string   `json:"delivery_target,omitempty"` // platform-specific recipient id
}

RouteConfig defines a webhook route.

type Router

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

Router manages webhook routes and dispatches events.

func NewRouter

func NewRouter(routes []RouteConfig, secret string, handler Handler) *Router

NewRouter creates a webhook router.

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP handles incoming webhook requests. Expected path: /webhook/<route-path>

Jump to

Keyboard shortcuts

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