Documentation
¶
Index ¶
- Constants
- type Option
- type StandardWebhookDestination
- func (d *StandardWebhookDestination) ComputeTarget(destination *models.Destination) destregistry.DestinationTarget
- func (d *StandardWebhookDestination) CreatePublisher(ctx context.Context, destination *models.Destination) (destregistry.Publisher, error)
- func (d *StandardWebhookDestination) ObfuscateDestination(destination *models.Destination) *models.Destination
- func (d *StandardWebhookDestination) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, ...) error
- func (d *StandardWebhookDestination) Validate(ctx context.Context, destination *models.Destination) error
- type StandardWebhookDestinationConfig
- type StandardWebhookDestinationCredentials
- type StandardWebhookPublisher
Constants ¶
View Source
const ( SecretPrefix = "whsec_" SecretLength = 32 // 32 bytes = 256 bits )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*StandardWebhookDestination)
Option is a functional option for configuring StandardWebhookDestination
func WithHeaderPrefix ¶
WithHeaderPrefix sets the prefix for metadata headers (defaults to "webhook-")
func WithProxyURL ¶
WithProxyURL sets the proxy URL for the webhook request
func WithUserAgent ¶
WithUserAgent sets the user agent for the webhook request
type StandardWebhookDestination ¶
type StandardWebhookDestination struct {
*destregistry.BaseProvider
// contains filtered or unexported fields
}
func New ¶
func New(loader metadata.MetadataLoader, basePublisherOpts []destregistry.BasePublisherOption, opts ...Option) (*StandardWebhookDestination, error)
func (*StandardWebhookDestination) ComputeTarget ¶
func (d *StandardWebhookDestination) ComputeTarget(destination *models.Destination) destregistry.DestinationTarget
func (*StandardWebhookDestination) CreatePublisher ¶
func (d *StandardWebhookDestination) CreatePublisher(ctx context.Context, destination *models.Destination) (destregistry.Publisher, error)
func (*StandardWebhookDestination) ObfuscateDestination ¶
func (d *StandardWebhookDestination) ObfuscateDestination(destination *models.Destination) *models.Destination
func (*StandardWebhookDestination) Preprocess ¶
func (d *StandardWebhookDestination) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, opts *destregistry.PreprocessDestinationOpts) error
Preprocess sets a default secret if one isn't provided and handles secret rotation
func (*StandardWebhookDestination) Validate ¶
func (d *StandardWebhookDestination) Validate(ctx context.Context, destination *models.Destination) error
type StandardWebhookDestinationConfig ¶
type StandardWebhookDestinationConfig struct {
URL string `json:"url"`
}
type StandardWebhookPublisher ¶
type StandardWebhookPublisher struct {
*destregistry.BasePublisher
// contains filtered or unexported fields
}
func (*StandardWebhookPublisher) Close ¶
func (p *StandardWebhookPublisher) Close() error
func (*StandardWebhookPublisher) Format ¶
func (p *StandardWebhookPublisher) Format(ctx context.Context, event *models.Event) (*http.Request, error)
Format creates an HTTP request formatted according to Standard Webhooks specification
func (*StandardWebhookPublisher) Publish ¶
func (p *StandardWebhookPublisher) Publish(ctx context.Context, event *models.Event) (*destregistry.Delivery, error)
Click to show internal directories.
Click to hide internal directories.