aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent.go
diff options
context:
space:
mode:
Diffstat (limited to 'meta/torrent.go')
-rw-r--r--meta/torrent.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/torrent.go b/meta/torrent.go
new file mode 100644
index 0000000..af71efb
--- /dev/null
+++ b/meta/torrent.go
@@ -0,0 +1,29 @@
+package meta
+
+import "time"
+
+type File struct {
+ Length int `bencode:"length"`
+ MD5Sum []byte `bencode:"md5sum,optional"`
+ Path []string `bencode:"path"`
+}
+
+type Info struct {
+ Length int `bencode:"length"`
+ MD5Sum []byte `bencode:"md5sum,optional"`
+ Name string `bencode:"name"`
+ PieceLength int `bencode:"piece length"`
+ Pieces []byte `bencode:"pieces"`
+ Files []File `bencode:"files"`
+}
+
+type Torrent struct {
+ Announce string `bencode:"announce"`
+ AnnounceList []string `bencode:"announce-list,optional"`
+ Comment string `bencode:"comment,optional"`
+ CreatedBy string `bencode:"created by,optional"`
+ CreationDate time.Time `bencode:"creation date,optional"`
+ HTTPSeeds []string `bencode:"httpseeds,optional"`
+ Info Info `bencode:"info"`
+ URLList string `bencode:"url-list,optional"`
+}