Versions in this module Expand all Collapse all v0 v0.1.0 May 10, 2026 Changes in this version + const BackoffBase + const BackoffMax + const FanoutBatch + const FanoutConsumer + const KindWebhookDeliver + const KindWebhookFanout + const KindWebhookPurgeOld + const MaxBodySize + const ResponseBodyCap + const SecretLength + var ErrBadContentType = errors.New("webhook: content_type must be json or form") + var ErrBadEvent = errors.New("webhook: event names must be 1–64 lowercase chars") + var ErrBadOwnerKind = errors.New("webhook: owner_kind must be repo or org") + var ErrBadURL = errors.New("webhook: URL must be http or https with a host") + func Backoff(attempt int, jitter func() float64) time.Duration + func Create(ctx context.Context, deps ManageDeps, params CreateParams) (webhookdb.Webhook, error) + func Delete(ctx context.Context, deps ManageDeps, hookID int64) error + func Deliver(ctx context.Context, deps DeliverDeps, deliveryID int64) error + func EnqueuePing(ctx context.Context, deps FanoutDeps, hookID int64) error + func FanoutOnce(ctx context.Context, deps FanoutDeps) (int, error) + func GenerateSecret() (string, error) + func IsSSRF(err error) bool + func MarshalDeliverPayload(deliveryID int64) ([]byte, error) + func OpenSecret(box *secretbox.Box, ciphertext, nonce []byte) (string, error) + func Redeliver(ctx context.Context, deps FanoutDeps, originalID int64) (int64, error) + func SealSecret(box *secretbox.Box, secret string) (ciphertext, nonce []byte, err error) + func SetActive(ctx context.Context, deps ManageDeps, hookID int64, active bool) error + func SignSHA256(secret, body []byte) string + func UnmarshalDeliverPayload(raw json.RawMessage) (int64, error) + func Update(ctx context.Context, deps ManageDeps, hookID int64, params UpdateParams) error + func VerifySHA256(secret, body []byte, sig string) bool + type CreateParams struct + Active bool + ActorUserID int64 + ContentType string + Events []string + OwnerID int64 + OwnerKind string + SSL bool + Secret string + URL string + type DeliverDeps struct + HTTPClient *http.Client + JitterFn func() float64 + Logger *slog.Logger + Pool *pgxpool.Pool + SSRF SSRFConfig + SecretBox *secretbox.Box + type FanoutDeps struct + Logger *slog.Logger + Pool *pgxpool.Pool + type ManageDeps struct + Pool *pgxpool.Pool + SSRF SSRFConfig + SecretBox *secretbox.Box + type SSRFConfig = ssrf.Config + func DefaultSSRFConfig() SSRFConfig + type SSRFError = ssrf.Error + type UpdateParams struct + Active bool + ContentType string + Events []string + NewSecret string + SSL bool + URL string