14 lines
426 B
Go
14 lines
426 B
Go
// Package transport provides common HTTP client middleware(aka transport) components.
|
|
package transport
|
|
|
|
import "net/http"
|
|
|
|
// RoundTripFunc similar to http.HandlerFunc, is an adapter
|
|
// to allow the use of ordinary functions as http.RoundTrippers.
|
|
type RoundTripFunc func(*http.Request) (*http.Response, error)
|
|
|
|
// RoundTrip ...
|
|
func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
return f(req)
|
|
}
|