Documentation
¶
Overview ¶
Package webhook implements notify.Notifier with an HTTP POST of a JSON body.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier sends notifications as HTTP POST requests with a JSON body of the form:
{"title":"…","body":"…","level":"info|warn|error"}
type Option ¶
type Option func(*Notifier)
Option configures a Notifier.
func WithBearerToken ¶
WithBearerToken sets the Authorization: Bearer <token> header.
func WithHeader ¶
WithHeader adds a static HTTP header to every request.
func WithTimeout ¶
WithTimeout overrides the default HTTP client timeout (10 seconds).