Versions in this module Expand all Collapse all v0 v0.1.0 Apr 15, 2023 Changes in this version + const ContentTypeJSON + const DefaultSignatureHeader + const EventPaymentCompleted + const EventPaymentCreated + const EventPaymentFailed + const EventPaymentPending + const TaskFireEvent + func SignPayload(payload []byte, secretKey []byte) (string, error) + func TranslateEventsToWebhookEvents(enq webhookEnqueuer) events.Listener + func VerifySignature(payload []byte, signature string, secretKey []byte) error + type Enqueuer struct + func NewEnqueuer(client *asynq.Client, opt ...EnqueuerOption) *Enqueuer + func (e *Enqueuer) FireEvent(ctx context.Context, event string, payload interface{}) error + type EnqueuerOption func(*Enqueuer) + func WithMaxRetry(n int) EnqueuerOption + func WithQueueName(name string) EnqueuerOption + func WithTaskDeadline(d time.Duration) EnqueuerOption + type FireEventPayload struct + Event string + Payload interface{} + type PaymentData struct + Amount uint64 + CreatedAt string + Currency string + Err *PaymentError + ExternalID string + PaymentID string + Status string + TxID string + type PaymentError struct + Code string + Details string + Message string + type Service struct + func NewService(opts ...ServiceOption) *Service + func (s *Service) FireEvent(event string, payload interface{}) error + func (s *Service) Send(url string, payload interface{}) (*http.Response, error) + type ServiceOption func(*Service) + func WithHTTPClient(client *http.Client) ServiceOption + func WithSignatureHeader(header string) ServiceOption + func WithSignatureSecret(secret []byte) ServiceOption + func WithWebhookURI(uri string) ServiceOption + type WebhookRequestPayload struct + Data interface{} + Event string + EventID string + WebhookID string + type Worker struct + func NewWorker(svc service) *Worker + func (w *Worker) FireEvent(ctx context.Context, t *asynq.Task) error + func (w *Worker) Register(mux *asynq.ServeMux)