webhook

package
v0.0.0-...-de12e2b Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package webhook provides HTTP handlers for processing GitHub webhook events, including signature validation and event extraction for broadcasting to subscribers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPRURL

func ExtractPRURL(ctx context.Context, eventType string, payload map[string]any) string

ExtractPRURL extracts the pull request URL from various event types.

func VerifySignature

func VerifySignature(payload []byte, signature, secret string) bool

VerifySignature validates the GitHub webhook signature. Uses constant-time operations to prevent timing attacks.

Types

type Handler

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

Handler handles GitHub webhook events.

func NewHandler

func NewHandler(h *srv.Hub, secret string, allowedEvents []string) *Handler

NewHandler creates a new webhook handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP processes GitHub webhook events.

Jump to

Keyboard shortcuts

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