Source File
error.go
Belonging Package
github.com/cenkalti/backoff/v5
package backoffimport ()// PermanentError signals that the operation should not be retried.type PermanentError struct {Err error}// Permanent wraps the given err in a *PermanentError.func ( error) error {if == nil {return nil}return &PermanentError{Err: ,}}// Error returns a string representation of the Permanent error.func ( *PermanentError) () string {return .Err.Error()}// Unwrap returns the wrapped error.func ( *PermanentError) () error {return .Err}// RetryAfterError signals that the operation should be retried after the given duration.type RetryAfterError struct {Duration time.Duration}// RetryAfter returns a RetryAfter error that specifies how long to wait before retrying.func ( int) error {return &RetryAfterError{Duration: time.Duration() * time.Second}}// Error returns a string representation of the RetryAfter error.func ( *RetryAfterError) () string {return fmt.Sprintf("retry after %s", .Duration)}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |