/
retrystrategy.go
30 lines (25 loc) · 942 Bytes
/
retrystrategy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2016 Canonical Ltd.
// Copyright 2016 Cloudbase Solutions
// Licensed under the AGPLv3, see LICENCE file for details.
package params
import (
"time"
)
// RetryStrategy holds the necessary information to configure retries.
type RetryStrategy struct {
ShouldRetry bool `json:"should-retry"`
MinRetryTime time.Duration `json:"min-retry-time"`
MaxRetryTime time.Duration `json:"max-retry-time"`
JitterRetryTime bool `json:"jitter-retry-time"`
RetryTimeFactor int64 `json:"retry-time-factor"`
}
// RetryStrategyResult holds a RetryStrategy or an error.
type RetryStrategyResult struct {
Error *Error `json:"error,omitempty"`
Result *RetryStrategy `json:"result,omitempty"`
}
// RetryStrategyResults holds the bulk operation result of an API call
// that returns a RetryStrategy or an error.
type RetryStrategyResults struct {
Results []RetryStrategyResult `json:"results"`
}