From a8f6dc7e8f46a5d11c01d9da1e887bb5a51fd107 Mon Sep 17 00:00:00 2001 From: Jan Seidl Date: Tue, 25 Feb 2020 14:37:54 +0100 Subject: [PATCH] release of #27 & #28 --- README.md | 19 +++++++++++++++++++ VERSION | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b6b103..a2541d1 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,18 @@ now implement via functions produces Options (aka `retry.OnRetry`) ## Usage +```go +var ( + DefaultAttempts = uint(10) + DefaultDelay = 100 * time.Millisecond + DefaultMaxJitter = 100 * time.Millisecond + DefaultOnRetry = func(n uint, err error) {} + DefaultRetryIf = IsRecoverable + DefaultDelayType = CombineDelay(BackOffDelay, RandomDelay) + DefaultLastErrorOnly = false +) +``` + #### func BackOffDelay ```go @@ -217,6 +229,13 @@ func LastErrorOnly(lastErrorOnly bool) Option return the direct last error that came from the retried function default is false (return wrapped errors with everything) +#### func MaxDelay + +```go +func MaxDelay(maxDelay time.Duration) Option +``` +MaxDelay set maximum delay between retry does not apply by default + #### func MaxJitter ```go diff --git a/VERSION b/VERSION index 35cee72..e70b452 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.3 +2.6.0