webhook

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 10 Imported by: ? 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

Overview

Package webhook contains the functionality for handling outcoming webhooks.

Index

Constants

View Source
const (

	// DefaultTimeoutSeconds is the number of seconds before a timeout occurs
	// when sending a webhook
	DefaultTimeoutSeconds = 10

	// MinHTTPStatusErrorCode is the lower bound of HTTP status codes which
	// indicate an error occurred
	MinHTTPStatusErrorCode = 400

	// SignatureHeader is the name of the HTTP header which contains the
	// webhook signature
	SignatureHeader = "X-Gophish-Signature"

	// Sha256Prefix is the prefix that specifies the hashing algorithm used
	// for the signature
	Sha256Prefix = "sha256"
)

Variables

This section is empty.

Functions

func Send

func Send(endPoint EndPoint, data interface{}) error

Send sends data to a single EndPoint

func SendAll

func SendAll(endPoints []EndPoint, data interface{})

SendAll sends data to multiple EndPoints

func SetTransport

func SetTransport(tr *http.Transport)

SetTransport sets the underlying transport for the default webhook client.

Types

type EndPoint

type EndPoint struct {
	URL    string
	Secret string
}

EndPoint represents a URL to send the webhook to, as well as a secret used to sign the event

type Sender

type Sender interface {
	Send(endPoint EndPoint, data interface{}) error
}

Sender represents a type which can send webhooks to an EndPoint

Jump to

Keyboard shortcuts

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