func (d DefaultRetryer) shouldThrottle(r *request.Request) bool {
	if r.HTTPResponse.StatusCode == 502 ||
		r.HTTPResponse.StatusCode == 503 ||
		r.HTTPResponse.StatusCode == 504 {
		return true
	}
	return r.IsErrorThrottle()
}
ShouldThrottle returns true if the request should be throttled.
package client
import (
	"math/rand"
	"sync"
	"time"
	"github.com/aws/aws-sdk-go/aws/request"
)
type DefaultRetryer struct {
	NumMaxRetries int
}
func (d DefaultRetryer) MaxRetries() int {
	return d.NumMaxRetries
}
var seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
	minTime := 30
	throttle := d.shouldThrottle(r)
	if throttle {
		minTime = 500
	}
	retryCount := r.RetryCount
	if retryCount > 13 {
		retryCount = 13
	} else if throttle && retryCount > 8 {
		retryCount = 8
	}
	delay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime)
	return time.Duration(delay) * time.Millisecond
}
func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
	if r.HTTPResponse.StatusCode >= 500 {
		return true
	}
	return r.IsErrorRetryable() || d.shouldThrottle(r)
}