]> Sergey Matveev's repositories - btrtrc.git/blobdiff - wstracker.go
Rename per-torrent ws tracker and output stats
[btrtrc.git] / wstracker.go
index 95780d774eb5fca1b69d550abf9c74bae4efc3d7..6f376c55e5aa3a805354f9fc9e73cfd492cecfe0 100644 (file)
@@ -12,16 +12,16 @@ import (
        "github.com/pion/datachannel"
 )
 
-type websocketTracker struct {
+type websocketTrackerStatus struct {
        url url.URL
-       *webtorrent.TrackerClient
+       tc  *webtorrent.TrackerClient
 }
 
-func (me websocketTracker) statusLine() string {
-       return fmt.Sprintf("%q", me.url.String())
+func (me websocketTrackerStatus) statusLine() string {
+       return fmt.Sprintf("%q: %+v", me.tc.Url, me.tc.Stats())
 }
 
-func (me websocketTracker) URL() url.URL {
+func (me websocketTrackerStatus) URL() url.URL {
        return me.url
 }