tracker: Add an explicit URL() method
Needed for merging tracker lists.
This commit is contained in:
parent
c4bae8f4c2
commit
285ecb8418
|
@ -45,6 +45,7 @@ type Client interface {
|
|||
Announce(*AnnounceRequest) (AnnounceResponse, error)
|
||||
Connect() error
|
||||
String() string
|
||||
URL() string
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue