Documentation
¶
Overview ¶
Package retry provides automatic retry handling for failed webhook deliveries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
CheckInterval time.Duration // How often to check for retryable deliveries
BatchSize int // Max number of deliveries to retry per check
MaxRetries int // Maximum retry attempts
}
Config holds configuration for the retry handler.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a default retry handler configuration.
type Logger ¶
type Logger interface {
Info(msg string, args ...any)
Error(msg string, args ...any)
Debug(msg string, args ...any)
Warn(msg string, args ...any)
}
Logger defines the logging interface for the retry handler.
type Option ¶
type Option func(*RetryHandler)
Option configures the RetryHandler.
func WithConfig ¶
WithConfig sets the configuration for the handler.
type RetryHandler ¶
type RetryHandler struct {
// contains filtered or unexported fields
}
RetryHandler periodically checks for and retries failed webhook deliveries.
func NewRetryHandler ¶
func NewRetryHandler( repo repository.WebhookRepository, svc *service.WebhookService, opts ...Option, ) *RetryHandler
NewRetryHandler creates a new retry handler.
func (*RetryHandler) IsRunning ¶
func (h *RetryHandler) IsRunning() bool
IsRunning returns whether the retry handler is currently running.
func (*RetryHandler) Start ¶
func (h *RetryHandler) Start(ctx context.Context)
Start begins the periodic retry processing.
func (*RetryHandler) Stop ¶
func (h *RetryHandler) Stop()
Stop gracefully shuts down the retry handler.
func (*RetryHandler) TriggerNow ¶
func (h *RetryHandler) TriggerNow()
TriggerNow forces an immediate retry check outside the normal schedule.