Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WebhookHttpClient = &http.Client{ Transport: otelhttp.NewTransport(http.DefaultTransport), }
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher interface {
// Publish a request to a "target". Target's meaning depends on the
// publisher: it's a URL in the case of a webhook publisher, or a queue
// name in a queue-based publisher such as NATS.
Publish(ctx context.Context, body string, headers map[string]string, method, target string)
}
Publisher interface wraps the Publish method that publishes an request with given "body" and "headers" to given "target"
type WebhookPublisher ¶
type WebhookPublisher struct {
// contains filtered or unexported fields
}
WebhookPublisher for a single URL. Satisfies the Publisher interface.
func MakeWebhookPublisher ¶
func MakeWebhookPublisher(logger *zap.Logger, baseURL string) *WebhookPublisher
MakeWebhookPublisher creates a WebhookPublisher object for the given baseURL
Click to show internal directories.
Click to hide internal directories.