Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoggingTransport ¶
type LoggingTransport struct { RoundTrips []*RoundTrip // contains filtered or unexported fields }
LoggingTransport is a transport which keeps track of all requests and responses
func NewLoggingTransport ¶
func NewLoggingTransport(tripper http.RoundTripper) *LoggingTransport
NewLoggingTransport creates a new logging transport
type RoundTrip ¶
type RoundTrip struct { Method string URL string RequestBody []byte Status int ResponseBody []byte StartedOn time.Time Elapsed time.Duration }
RoundTrip represents a single request / response round trip created by our transport. In the case of connection errors, the status code will be set to 499 and the response body will contain more information about the error encountered
type UserAgentTransport ¶
type UserAgentTransport struct {
// contains filtered or unexported fields
}
UserAgentTransport just injects a custom user agent on the request before sending it out
func NewUserAgentTransport ¶
func NewUserAgentTransport(tripper http.RoundTripper, agent string) *UserAgentTransport
NewUserAgentTransport creates a new transport that injects a user agent in all requests
Click to show internal directories.
Click to hide internal directories.