webhook

package
v0.260430.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package webhook provides an HTTP webhook notification provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider)

Option configures a webhook Provider

func WithAuth

func WithAuth(auth string) Option

WithAuth sets an Authorization header

func WithClient

func WithClient(client *http.Client) Option

WithClient sets a custom HTTP client

func WithHeaders

func WithHeaders(headers map[string]string) Option

WithHeaders sets custom HTTP headers

func WithMethod

func WithMethod(method string) Option

WithMethod sets the HTTP method (default: POST)

func WithName

func WithName(name string) Option

WithName sets a custom provider name

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the request timeout

type Provider

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

Provider sends notifications to HTTP webhooks

func New

func New(url string, opts ...Option) *Provider

New creates a new webhook provider

func (*Provider) Close

func (p *Provider) Close() error

Close cleans up provider resources

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name

func (*Provider) Send

func (p *Provider) Send(ctx context.Context, notification *notify.Notification) (*notify.Result, error)

Send sends a notification to the webhook

Jump to

Keyboard shortcuts

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