AddRetryHook adds a retry hook which will be executed before a retry.
(hook RetryHookFunc)
| 1207 | |
| 1208 | // AddRetryHook adds a retry hook which will be executed before a retry. |
| 1209 | func (r *Request) AddRetryHook(hook RetryHookFunc) *Request { |
| 1210 | ro := r.getRetryOption() |
| 1211 | ro.RetryHooks = append(ro.RetryHooks, hook) |
| 1212 | return r |
| 1213 | } |
| 1214 | |
| 1215 | // SetRetryCondition sets the retry condition, which determines whether the |
| 1216 | // request should retry. |