diff --git a/torrent.go b/torrent.go index dbe2a1f..fb0b586 100644 --- a/torrent.go +++ b/torrent.go @@ -1,6 +1,9 @@ package model -import "time" +import ( + "fmt" + "time" +) type Torrent struct { ID TorrentID @@ -14,3 +17,15 @@ type Torrent struct { } type TorrentID string + +func (t Torrent) String() string { + return fmt.Sprintf("id: %s | title: %s | seeders: %d | leechers: %d | downloads: %d | trusted: %t | upload time: %s", + t.ID, + t.Title, + t.Seeders, + t.Leechers, + t.Downloads, + t.Trusted, + t.Time, + ) +}