Documentation
¶
Overview ¶
Package receiver provides an interface for the receipt of webhook messages.
Index ¶
- func NewInsecureReceiver(ctx context.Context, uri string) (webhookd.WebhookReceiver, error)
- func NewReceiver(ctx context.Context, uri string) (webhookd.WebhookReceiver, error)
- func Receivers() []string
- func RegisterReceiver(ctx context.Context, scheme string, init_func ReceiverInitializationFunc) error
- func Schemes() []string
- type InsecureReceiver
- type ReceiverInitializationFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInsecureReceiver ¶
NewInsecureReceiver returns a new `InsecureReceiver` instance configured by 'uri' in the form of:
insecure://
func NewReceiver ¶
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.
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.