Closed medakk closed 6 years ago
This PR allows you to create a Retrier without creating a struct to satisfy the interface, just a function. Similar to http.Handler and http.HandlerFunc
Example:
linearRetrier := NewRetrierFunc(func(retry int) time.Duration { if retry <= 0 { return 0 * time.Millisecond } return time.Duration(retry) * time.Millisecond }) client := heimdall.NewHTTPClient(timeout) client.SetRetrier(retrier)
@medakk Can you add this to docs too ?
Comments for go doc are present. Do you mean the project's README.md?
@medakk Yes, README
Doc has been added.
@medakk Thanks will merge.
This PR allows you to create a Retrier without creating a struct to satisfy the interface, just a function. Similar to http.Handler and http.HandlerFunc
Example: