Do runs the passed function until the number of retries is reached. Whenever Func returns err it will sleep and Func will be executed again in a recursive fashion. The sleep value is slightly modified on every retry (exponential backoff) to prevent the thundering herd problem (https://en.wikipedia.org/wiki/Thundering_herd_problem). If no value is given to sleep it will defaults to 500ms.
DoHTTP wraps Func and returns *http.Response and error as returning arguments.
Func is the function to be executed and eventually retried.
HTTPFunc is the function to be executed and eventually retried. The only difference from Func is that it expects an *http.Response on the first returning argument.