func (d *Doer) Do(r *http.Request) (*http.Response, error) {
	if d.Custom != nil {
		return d.Custom(r)
	}
	timer := time.NewTimer(d.ResponseTime)
	<-timer.C
	if d.ResponseBody != nil {
		d.ResponseBody.lastPos = 0
		d.ResponseBody.closed = false
		d.Response.Body = d.ResponseBody
	}
	return &d.Response, nil
}
Do returns the set HTTP response attribute after waiting for the specified amount of time
if a custom function is specified it is used instead
package mock
import (
	"encoding/json"
	"fmt"
	"net/http"
	"time"
)
type Doer struct {
	Response     http.Response
	ResponseBody *ResponseBody
	ResponseTime time.Duration
	Custom       func(r *http.Request) (*http.Response, error)
}
func NewJSONMockDoer(object interface{}, code int) *Doer {
	buffer, _ := json.Marshal(object)
	body := ResponseBody{
		Content: buffer,
	}
	return &Doer{
		Response: http.Response{
			Body:       &body,
			StatusCode: code,
		},
		ResponseBody: &body,
	}
}
func NewStatusMockDoer(code int) *Doer {
	return &Doer{
		Response: http.Response{
			StatusCode: code,
		},
	}
}
func NewHeaderMockDoer(code int, headers http.Header) *Doer {
	return &Doer{
		Response: http.Response{
			StatusCode: code,
			Header:     headers,
		},
	}
}