Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfoDict ¶
type InfoDict struct {
PieceLength int64 `bencode:"piece length"`
Pieces string `bencode:"pieces"`
Private int64 `bencode:"private,omitempty"`
Name string `bencode:"name"`
// Single file mode
Length int64 `bencode:"length,omitempty"`
// Multi-file mode
Files []FileInfo `bencode:"files,omitempty"`
}
InfoDict represents the info dictionary in a torrent file
func (*InfoDict) GetPieceHashes ¶
GetPieceHashes returns the list of piece hashes
func (*InfoDict) IsSingleFile ¶
IsSingleFile returns true if this is a single-file torrent
func (*InfoDict) MarshalJSON ¶
MarshalJSON customizes JSON output for InfoDict
func (*InfoDict) TotalLength ¶
TotalLength returns the total size of the torrent
type MetaInfo ¶
type MetaInfo struct {
Announce string `bencode:"announce"`
AnnounceList [][]string `bencode:"announce-list,omitempty"`
Comment string `bencode:"comment,omitempty"`
CreatedBy string `bencode:"created by,omitempty"`
CreationDate int64 `bencode:"creation date,omitempty"`
Info InfoDict `bencode:"info"`
InfoHash dht.Key `bencode:"-"`
}
MetaInfo represents the complete torrent file structure
func ParseMetadata ¶
ParseMetadata parses metadata from raw bytes (used for BEP 9 metadata exchange)
func (*MetaInfo) GetTrackers ¶
GetTrackers returns all trackers from announce and announce-list
func (*MetaInfo) MarshalJSON ¶
MarshalJSON customizes JSON output for MetaInfo
Click to show internal directories.
Click to hide internal directories.