tracker: Add an explicit URL() method

Needed for merging tracker lists.
This commit is contained in:
Matt Joiner 2014-11-20 23:39:56 -06:00
parent c4bae8f4c2
commit 285ecb8418
2 changed files with 6 additions and 1 deletions

View File

@ -45,6 +45,7 @@ type Client interface {
Announce(*AnnounceRequest) (AnnounceResponse, error)
Connect() error
String() string
URL() string
}
var (

View File

@ -87,10 +87,14 @@ type client struct {
url *url.URL
}
func (c *client) String() string {
func (c *client) URL() string {
return c.url.String()
}
func (c *client) String() string {
return c.URL()
}
func (c *client) Announce(req *tracker.AnnounceRequest) (res tracker.AnnounceResponse, err error) {
if !c.connected() {
err = tracker.ErrNotConnected