func AfterDelay(d time.Duration) SendDecorator {
	return func(s Sender) Sender {
		return SenderFunc(func(r *http.Request) (*http.Response, error) {
			if !DelayForBackoff(d, 0, r.Cancel) {
				return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay")
			}
			return s.Do(r)
		})
	}
}
AfterDelay returns a SendDecorator that delays for the passed time.Duration before
invoking the Sender. The delay may be terminated by closing the optional channel on the
http.Request. If canceled, no further Senders are invoked.
package autorest
import (
	"fmt"
	"log"
	"math"
	"net/http"
	"strconv"
	"time"
)
type Sender interface {
	Do(*http.Request) (*http.Response, error)
}
type SenderFunc func(*http.Request) (*http.Response, error)
func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
	return sf(r)
}
type SendDecorator func(Sender) Sender
func CreateSender(decorators ...SendDecorator) Sender {
	return DecorateSender(&http.Client{}, decorators...)
}
func DecorateSender(s Sender, decorators ...SendDecorator) Sender {
	for _, decorate := range decorators {
		s = decorate(s)
	}
	return s
}
func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
	return SendWithSender(&http.Client{}, r, decorators...)
}
func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
	return DecorateSender(s, decorators...).Do(r)
}