Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClientConfiguration = ClientConfiguration{
UserAgent: "Grafana",
}
View Source
var ErrInvalidMethod = errors.New("webhook only supports HTTP methods PUT or POST")
Functions ¶
func GetBasicAuthHeader ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendWebhook ¶
type ClientConfiguration ¶
type ClientConfiguration struct {
UserAgent string
}
type ForkedSender ¶
type ForkedSender struct {
// contains filtered or unexported fields
}
func NewForkedSender ¶
func NewForkedSender(cli receivers.WebhookSender) *ForkedSender
func (ForkedSender) SendWebhook ¶
func (f ForkedSender) SendWebhook(ctx context.Context, cmd *receivers.SendWebhookSettings) error
type HMACRoundTripper ¶
type HMACRoundTripper struct {
// contains filtered or unexported fields
}
HMACRoundTripper is an HTTP transport that signs outgoing requests using HMAC SHA256. It can optionally include a timestamp in the signature calculation (if timestampHeader is not empty) and supports custom header names for both the signature and timestamp values.
func NewHMACRoundTripper ¶
func NewHMACRoundTripper(wrapped http.RoundTripper, clk clock.Clock, secret, header, timestampHeader string) (*HMACRoundTripper, error)
NewHMACRoundTripper creates a new HMACRoundTripper that wraps the provided RoundTripper. It signs requests using the provided secret key and places the signature in the specified header. If header is empty, it defaults to "X-Grafana-Alert-Signature". If timestampHeader is non-empty, the current timestamp will be included in the signature calculation and set in the specified header.
Click to show internal directories.
Click to hide internal directories.