From: Matt Joiner Date: Fri, 5 Feb 2016 04:42:23 +0000 (+1100) Subject: tracker: Rename the http client type to httpClient X-Git-Tag: v1.0.0~917 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1ea9beb802a13edfc5f8a3d381f56c72acba45cf;p=btrtrc.git tracker: Rename the http client type to httpClient --- diff --git a/tracker/http.go b/tracker/http.go index 15916ee9..3a733462 100644 --- a/tracker/http.go +++ b/tracker/http.go @@ -18,12 +18,12 @@ func init() { RegisterClientScheme("http", NewClient) } -type client struct { +type httpClient struct { url url.URL } func NewClient(url *url.URL) Client { - return &client{ + return &httpClient{ url: *url, } } @@ -54,7 +54,7 @@ func (r *response) UnmarshalPeers() (ret []Peer, err error) { return } -func (me *client) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) { +func (me *httpClient) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error) { q := make(url.Values) q.Set("info_hash", string(ar.InfoHash[:])) q.Set("peer_id", string(ar.PeerId[:])) @@ -99,15 +99,15 @@ func (me *client) Announce(ar *AnnounceRequest) (ret AnnounceResponse, err error return } -func (me *client) Connect() error { +func (me *httpClient) Connect() error { // HTTP trackers do not require a connecting handshake. return nil } -func (me *client) String() string { +func (me *httpClient) String() string { return me.URL() } -func (me *client) URL() string { +func (me *httpClient) URL() string { return me.url.String() }