Versions in this module Expand all Collapse all v1 v1.1.0 Dec 2, 2025 Changes in this version + type CartCheckoutEvent struct + CartID string + ItemCount int + Metadata map[string]string + PaymentMethod string + Status string + Timestamp time.Time + Token string + TotalAmount int64 + Wallet string + type CartCreatedEvent struct + CartID string + ExpiresAt time.Time + ItemCount int + Metadata map[string]string + Timestamp time.Time + Token string + TotalAmount int64 + type CartHook interface + OnCartCheckout func(ctx context.Context, event CartCheckoutEvent) + OnCartCreated func(ctx context.Context, event CartCreatedEvent) + type DatabaseHook interface + OnDatabaseQuery func(ctx context.Context, event DatabaseQueryEvent) + type DatabaseQueryEvent struct + Backend string + Duration time.Duration + Error string + Metadata map[string]string + Operation string + Success bool + Timestamp time.Time + type Hook interface + Name func() string + type PaymentCompletedEvent struct + Amount int64 + Duration time.Duration + ErrorReason string + Metadata map[string]string + Method string + PaymentID string + ResourceID string + Success bool + Timestamp time.Time + Token string + TransactionID string + Wallet string + type PaymentHook interface + OnPaymentCompleted func(ctx context.Context, event PaymentCompletedEvent) + OnPaymentSettled func(ctx context.Context, event PaymentSettledEvent) + OnPaymentStarted func(ctx context.Context, event PaymentStartedEvent) + type PaymentSettledEvent struct + Confirmations int + Network string + PaymentID string + SettlementDuration time.Duration + Timestamp time.Time + TransactionID string + type PaymentStartedEvent struct + Amount int64 + Metadata map[string]string + Method string + PaymentID string + ResourceID string + Timestamp time.Time + Token string + Wallet string + type PrometheusHook struct + func NewPrometheusHook(m *metrics.Metrics) *PrometheusHook + func (h *PrometheusHook) Name() string + func (h *PrometheusHook) OnCartCheckout(ctx context.Context, event CartCheckoutEvent) + func (h *PrometheusHook) OnCartCreated(ctx context.Context, event CartCreatedEvent) + func (h *PrometheusHook) OnDatabaseQuery(ctx context.Context, event DatabaseQueryEvent) + func (h *PrometheusHook) OnPaymentCompleted(ctx context.Context, event PaymentCompletedEvent) + func (h *PrometheusHook) OnPaymentSettled(ctx context.Context, event PaymentSettledEvent) + func (h *PrometheusHook) OnPaymentStarted(ctx context.Context, event PaymentStartedEvent) + func (h *PrometheusHook) OnRPCCall(ctx context.Context, event RPCCallEvent) + func (h *PrometheusHook) OnRefundProcessed(ctx context.Context, event RefundProcessedEvent) + func (h *PrometheusHook) OnRefundRequested(ctx context.Context, event RefundRequestedEvent) + func (h *PrometheusHook) OnWebhookDelivered(ctx context.Context, event WebhookDeliveredEvent) + func (h *PrometheusHook) OnWebhookFailed(ctx context.Context, event WebhookFailedEvent) + func (h *PrometheusHook) OnWebhookQueued(ctx context.Context, event WebhookQueuedEvent) + func (h *PrometheusHook) OnWebhookRetried(ctx context.Context, event WebhookRetriedEvent) + type RPCCallEvent struct + Duration time.Duration + ErrorType string + Metadata map[string]string + Method string + Network string + Success bool + Timestamp time.Time + type RPCHook interface + OnRPCCall func(ctx context.Context, event RPCCallEvent) + type RefundHook interface + OnRefundProcessed func(ctx context.Context, event RefundProcessedEvent) + OnRefundRequested func(ctx context.Context, event RefundRequestedEvent) + type RefundProcessedEvent struct + Amount int64 + Duration time.Duration + ErrorReason string + Metadata map[string]string + OriginalPurchaseID string + RefundID string + Success bool + Timestamp time.Time + Token string + TransactionID string + type RefundRequestedEvent struct + Amount int64 + Metadata map[string]string + OriginalPurchaseID string + Reason string + RecipientWallet string + RefundID string + Timestamp time.Time + Token string + type Registry struct + func NewRegistry(logger zerolog.Logger) *Registry + func (r *Registry) EmitCartCheckout(ctx context.Context, event CartCheckoutEvent) + func (r *Registry) EmitCartCreated(ctx context.Context, event CartCreatedEvent) + func (r *Registry) EmitDatabaseQuery(ctx context.Context, event DatabaseQueryEvent) + func (r *Registry) EmitPaymentCompleted(ctx context.Context, event PaymentCompletedEvent) + func (r *Registry) EmitPaymentSettled(ctx context.Context, event PaymentSettledEvent) + func (r *Registry) EmitPaymentStarted(ctx context.Context, event PaymentStartedEvent) + func (r *Registry) EmitRPCCall(ctx context.Context, event RPCCallEvent) + func (r *Registry) EmitRefundProcessed(ctx context.Context, event RefundProcessedEvent) + func (r *Registry) EmitRefundRequested(ctx context.Context, event RefundRequestedEvent) + func (r *Registry) EmitWebhookDelivered(ctx context.Context, event WebhookDeliveredEvent) + func (r *Registry) EmitWebhookFailed(ctx context.Context, event WebhookFailedEvent) + func (r *Registry) EmitWebhookQueued(ctx context.Context, event WebhookQueuedEvent) + func (r *Registry) EmitWebhookRetried(ctx context.Context, event WebhookRetriedEvent) + func (r *Registry) RegisterCartHook(hook CartHook) + func (r *Registry) RegisterDatabaseHook(hook DatabaseHook) + func (r *Registry) RegisterPaymentHook(hook PaymentHook) + func (r *Registry) RegisterRPCHook(hook RPCHook) + func (r *Registry) RegisterRefundHook(hook RefundHook) + func (r *Registry) RegisterWebhookHook(hook WebhookHook) + type WebhookDeliveredEvent struct + Attempts int + Duration time.Duration + EventID string + EventType string + StatusCode int + Timestamp time.Time + URL string + WebhookID string + type WebhookFailedEvent struct + Attempts int + Error string + EventID string + EventType string + FinalFailure bool + Timestamp time.Time + URL string + WebhookID string + type WebhookHook interface + OnWebhookDelivered func(ctx context.Context, event WebhookDeliveredEvent) + OnWebhookFailed func(ctx context.Context, event WebhookFailedEvent) + OnWebhookQueued func(ctx context.Context, event WebhookQueuedEvent) + OnWebhookRetried func(ctx context.Context, event WebhookRetriedEvent) + type WebhookQueuedEvent struct + EventID string + EventType string + Metadata map[string]string + Timestamp time.Time + URL string + WebhookID string + type WebhookRetriedEvent struct + BackoffSeconds float64 + CurrentAttempt int + EventID string + EventType string + MaxAttempts int + NextRetryAt time.Time + Timestamp time.Time + URL string + WebhookID string