webhook

package
v0.0.0-...-ed20651 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 12 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(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.

Types

type Handler

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

Handler handles GitHub webhook events.

func NewHandler

func NewHandler(h *hub.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