Documentation
¶
Overview ¶
Package webhook provides an HTTP client for posting failure notifications to a configured webhook endpoint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
URL string
}
Client sends failure notifications to a webhook endpoint.
func (*Client) NotifyFailure ¶
func (c *Client) NotifyFailure(ctx context.Context, event FailureEvent) error
NotifyFailure sends an HTTP POST to c.URL with the failure event payload. If c.URL is empty the call is a no-op and nil is returned. If the endpoint returns a non-2xx status code, a non-nil error is returned containing the status code.