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