Documentation
¶
Overview ¶
Package webhook implements a generic gateway.NotificationAdapter that receives arbitrary JSON payloads via HTTP POST.
Index ¶
- type Adapter
- func (a *Adapter) Channels() []gateway.ChannelInfo
- func (a *Adapter) HTTPHandler() http.Handler
- func (a *Adapter) Name() string
- func (a *Adapter) Start(_ context.Context, handler func(gateway.Notification)) error
- func (a *Adapter) Status() gateway.AdapterStatus
- func (a *Adapter) Stop() error
- func (a *Adapter) Type() gateway.AdapterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements gateway.NotificationAdapter for generic webhooks.
func New ¶
func New() *Adapter
New creates a new generic webhook adapter with the default name "webhook".
func NewWithSecret ¶
NewWithSecret creates a named webhook adapter with shared-secret auth. The secret is validated against Authorization: Bearer <secret> or X-Webhook-Secret: <secret> headers.
func (*Adapter) Channels ¶
func (a *Adapter) Channels() []gateway.ChannelInfo
Channels returns the adapter name as a single channel.
func (*Adapter) HTTPHandler ¶
HTTPHandler returns an http.Handler that receives and processes generic webhook payloads.
func (*Adapter) Status ¶
func (a *Adapter) Status() gateway.AdapterStatus
Status returns the adapter's connection state.
Click to show internal directories.
Click to hide internal directories.