aboutsummaryrefslogtreecommitdiff
path: root/meta/torrent.go
blob: 56a6a9735a25c61566b5488fb895619f7eabc5c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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"`
	Private     bool   `bencode:"private"`
}

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"`
	InfoHash     []byte    `bencode:"-"`
}