Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = &http.Client{Transport: DefaultTransport}
View Source
var DefaultTransport = NewTransport()
View Source
var (
ErrServerNotFound = errors.New("server not found")
)
Functions ¶
Types ¶
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an mock implementation of RoundTripper that supports HTTP, HTTPS, and HTTP proxies (for either HTTP or HTTPS with CONNECT).
func NewTransport ¶
func NewTransport() *Transport
NewTransport creates a new mock RoundTripper object.
func (*Transport) ListenAndServe ¶
ListenAndServe listens on a mock network address addr and handler to handle requests on incoming connections.
func (*Transport) RoundTrip ¶
RoundTrip executes a single HTTP transaction, returning a Response for the provided Request.
func (*Transport) SetRemoteAddr ¶ added in v1.11.7
SetRemoteAddr sets the remote network address.
Click to show internal directories.
Click to hide internal directories.