From a75f52e481d787bd57530114852696bb59a62b82 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 11 Jun 2016 01:46:33 +0200 Subject: marshal --- torrent/torrent.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'torrent') 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 } -- cgit v1.2.3