Versions in this module Expand all Collapse all v1 v1.0.0 Mar 7, 2026 Changes in this version + func IsNonRetryable(err error) bool + func IsRetryable(err error) bool + func NewHTTPError(code int, message string) error + func NewNonRetryableError(err error) error + func NewRetryableError(err error) error + type Backoff struct + func NewBackoff(config BackoffConfig) *Backoff + func (b *Backoff) Next(attempt int) time.Duration + func (b *Backoff) NextSequence(numAttempts int) []time.Duration + func (b *Backoff) Reset() + type BackoffConfig struct + InitialDelay time.Duration + JitterEnabled bool + MaxDelay time.Duration + Multiplier float64 + type Coordinator struct + func NewCoordinator(config CoordinatorConfig, retry *RetryHandler, circuit *shared.CircuitBreaker, ...) *Coordinator + func (c *Coordinator) Execute(ctx context.Context, job *entity.Job, fn func(context.Context) error) error + func (c *Coordinator) ExecuteWithResult(ctx context.Context, job *entity.Job, fn func(context.Context) (any, error)) (any, error) + func (c *Coordinator) GetCircuitState() shared.CircuitBreakerState + func (c *Coordinator) GetDLQCount(ctx context.Context) (int, error) + func (c *Coordinator) RetryFromDLQ(ctx context.Context, jobID string) (*entity.Job, error) + type CoordinatorConfig struct + EnableCircuit bool + EnableDLQ bool + EnableRetry bool + func DefaultCoordinatorConfig() CoordinatorConfig + type DLQConfig struct + MaxAttempts int + RetryAfter time.Duration + Storage port.StoragePort + type DLQEntry struct + Attempts int + Error string + JobID string + NextRetry *time.Time + Payload any + Priority entity.Priority + Timestamp time.Time + type DeadLetterQueue struct + func NewDeadLetterQueue(config DLQConfig) (*DeadLetterQueue, error) + func (dlq *DeadLetterQueue) Add(ctx context.Context, job *entity.Job, err error) error + func (dlq *DeadLetterQueue) Clear(ctx context.Context) error + func (dlq *DeadLetterQueue) Count(ctx context.Context) (int, error) + func (dlq *DeadLetterQueue) GetFailed(ctx context.Context, limit int) ([]*DLQEntry, error) + func (dlq *DeadLetterQueue) GetRetryable(ctx context.Context, limit int) ([]*entity.Job, error) + func (dlq *DeadLetterQueue) Remove(ctx context.Context, jobID string) error + func (dlq *DeadLetterQueue) Retry(ctx context.Context, jobID string) (*entity.Job, error) + type HTTPStatusCodeError struct + Code int + Message string + func (e *HTTPStatusCodeError) Error() string + func (e *HTTPStatusCodeError) StatusCode() int + type NonRetryableError struct + Err error + func (e *NonRetryableError) Error() string + func (e *NonRetryableError) Unwrap() error + type RetryConfig struct + InitialDelay time.Duration + JitterEnabled bool + MaxAttempts int + MaxDelay time.Duration + Multiplier float64 + func DefaultRetryConfig() RetryConfig + type RetryHandler struct + func NewRetryHandler(config RetryConfig) *RetryHandler + func (rh *RetryHandler) Do(ctx context.Context, fn func() error) error + func (rh *RetryHandler) DoWithResult(ctx context.Context, fn func() (any, error)) (any, error) + func (rh *RetryHandler) SetPolicy(policy *RetryPolicy) + type RetryPolicy struct + func NewRetryPolicy() *RetryPolicy + func (p *RetryPolicy) AddRetriableError(err error) + func (p *RetryPolicy) ClearCustomCheck() + func (p *RetryPolicy) IsRetriable(err error) bool + func (p *RetryPolicy) RemoveRetriableError(err error) + func (p *RetryPolicy) SetCustomCheck(fn func(error) bool) + type RetryableError struct + Err error + func (e *RetryableError) Error() string + func (e *RetryableError) Unwrap() error