aboutsummaryrefslogtreecommitdiff
path: root/torrent
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-06-11 01:46:33 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-06-11 01:46:33 +0200
commita75f52e481d787bd57530114852696bb59a62b82 (patch)
treeed4bd6df9069868a117c57d13a0ccc688f66aca5 /torrent
parent9e26bb7935e283cd2efb6ce3956e193f3a908412 (diff)
marshal
Diffstat (limited to 'torrent')
-rw-r--r--torrent/torrent.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/torrent/torrent.go b/torrent/torrent.go
index f6e7678..0f7d673 100644
--- a/torrent/torrent.go
+++ b/torrent/torrent.go
@@ -1,14 +1,14 @@
-import "time"
+package torrent
type File struct {
Length int `bencode:"length"`
- MD5Sum []byte `bencode:"md5sum,omitempty"`
+ MD5Sum []byte `bencode:"md5sum,optional"`
Path string `bencode:"path"`
}
type Info struct {
Length int `bencode:"length"`
- MD5Sum []byte `bencode:"md5sum,omitempty"`
+ MD5Sum []byte `bencode:"md5sum,optional"`
Name string `bencode:"name"`
PieceLength int `bencode:"piece length"`
Pieces []byte `bencode:"pieces"`
@@ -16,12 +16,12 @@ type Info struct {
}
type Torrent struct {
- Announce string `bencode:"announce"`
- AnnounceList []string `bencode:"announce-list,omitemtpy"`
- Comment string `bencode:"comment"`
- CreatedBy string `bencode:"created by,omitempty"`
- CreationDate time.Time `bencode:"creation date"`
- HTTPSeeds []string `bencode:"httpseeds"` // not in draft
- Info Info `bencode:"info"`
- URLList string `bencode:"url-list,omitemtpy"` // not in draft
+ Announce string `bencode:"announce"`
+ AnnounceList []string `bencode:"announce-list,optional"`
+ Comment string `bencode:"comment"`
+ CreatedBy string `bencode:"created by,optional"`
+ CreationDate int `bencode:"creation date"` // time.Time (unix time)
+ HTTPSeeds []string `bencode:"httpseeds,optional"` // not in draft
+ Info Info `bencode:"info"`
+ URLList string `bencode:"url-list,optional"` // not in draft
}