receiver

package
v3.3.6 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Overview

Package receiver provides an interface for the receipt of webhook messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInsecureReceiver

func NewInsecureReceiver(ctx context.Context, uri string) (webhookd.WebhookReceiver, error)

NewInsecureReceiver returns a new `InsecureReceiver` instance configured by 'uri' in the form of:

insecure://

func NewReceiver

func NewReceiver(ctx context.Context, uri string) (webhookd.WebhookReceiver, error)

NewReceiver() returns a new `webhookd.WebhookReceiver` instance derived from 'uri'. The semantics of and requirements for 'uri' as specific to the package implementing the interface.

func Receivers

func Receivers() []string

Receivers() returns the list of schemes that have been "registered". This method is deprecated and you should use `Schemes()` instead.

func RegisterReceiver

func RegisterReceiver(ctx context.Context, scheme string, init_func ReceiverInitializationFunc) error

RegisterReceiver() associates 'scheme' with 'init_func' in an internal list of avilable `webhookd.WebhookReceiver` implementations.

func Schemes added in v3.1.0

func Schemes() []string

Schemes() returns the list of schemes that have been "registered".

Types

type InsecureReceiver

type InsecureReceiver struct {
	webhookd.WebhookReceiver
}

LogReceiver implements the `webhookd.WebhookReceiver` interface for receiving webhook messages in an insecure fashion.

func (InsecureReceiver) Receive

func (wh InsecureReceiver) Receive(ctx context.Context, req *http.Request) ([]byte, *webhookd.WebhookError)

Receive returns the body of the message in 'req'. It does not check its provenance or validate the message body in any way. You should not use this in production.

type ReceiverInitializationFunc

type ReceiverInitializationFunc func(ctx context.Context, uri string) (webhookd.WebhookReceiver, error)

ReceiverInitializationFunc is a function used to initialize an implementation of the `webhookd.WebhookReceiver` interface.

Jump to

Keyboard shortcuts

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