rename the h2quic.QuicRoundTripper to h2quic.RoundTripper

This commit is contained in:
Marten Seemann
2017-06-26 19:01:48 +02:00
parent a1680e8670
commit 9df3380bc6
7 changed files with 16 additions and 15 deletions

View File

@@ -11,8 +11,8 @@ import (
"golang.org/x/net/lex/httplex"
)
// QuicRoundTripper implements the http.RoundTripper interface
type QuicRoundTripper struct {
// RoundTripper implements the http.RoundTripper interface
type RoundTripper struct {
mutex sync.Mutex
// DisableCompression, if true, prevents the Transport from
@@ -32,10 +32,10 @@ type QuicRoundTripper struct {
clients map[string]http.RoundTripper
}
var _ http.RoundTripper = &QuicRoundTripper{}
var _ http.RoundTripper = &RoundTripper{}
// RoundTrip does a round trip
func (r *QuicRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
if req.URL == nil {
closeRequestBody(req)
return nil, errors.New("quic: nil Request.URL")
@@ -74,7 +74,7 @@ func (r *QuicRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)
return r.getClient(hostname).RoundTrip(req)
}
func (r *QuicRoundTripper) getClient(hostname string) http.RoundTripper {
func (r *RoundTripper) getClient(hostname string) http.RoundTripper {
r.mutex.Lock()
defer r.mutex.Unlock()