Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 705 Bytes

README.md

File metadata and controls

39 lines (31 loc) · 705 Bytes

retry-go GoDoc

🔁 Minimal retry library for Go

Usage

Basic example:

var res *http.Response
var err error
for r := retry.Exp(5, time.Second); r.Next(err); {
  res, err = http.Get("https://example.com")
}
if err != nil {
  // ...
}

Reusable retryer with custom DurationFunc

var retryF = retry.Factory(3, func (i time.Duration) time.Duration {
  return 15 * i * time.Second
})

var res *http.Response
var err error
for r := retryF(); r.Next(err); {
  res, err = http.Get("https://example.com")
}
if err != nil {
  // ...
}

Changelog

v0.1.0

Initial release