Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartTestServer ¶
StartTestServer creates and starts an *httptest.Server in the background, then parses its URL and returns both values.
If this function returns a nil error, the caller is responsible for closing the returned server. If it returns a non-nil error, the server and URL will be nil.
Types ¶
type DialContextFunc ¶
DialContextFunc matches the signature of net.Dialer.DialContext.
func DialContextWithRetry ¶
func DialContextWithRetry(connectTimeout time.Duration) DialContextFunc
DialContextWithRetry returns a DialContextFunc that retries failed dials at a fixed interval until the parent context is cancelled or its deadline expires. When the parent context has no deadline, retries are bounded by maxRetryDuration.
type TestHTTPHandlerWrapper ¶
type TestHTTPHandlerWrapper struct {
// contains filtered or unexported fields
}
func NewTestHTTPHandlerWrapper ¶
func NewTestHTTPHandlerWrapper(hdl http.Handler) *TestHTTPHandlerWrapper
func (*TestHTTPHandlerWrapper) IncomingRequests ¶
func (t *TestHTTPHandlerWrapper) IncomingRequests() []http.Request
IncomingRequests returns a copy slice of all the requests that have been received before this function was called.
func (*TestHTTPHandlerWrapper) ServeHTTP ¶
func (t *TestHTTPHandlerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)