bencode

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(r io.Reader) (*bencodeTorrent, error)

Unmarshal reads a stream and translates into bencode torrent

Types

type TorrentFile

type TorrentFile struct {
	Announce    string
	InfoHash    [20]byte
	PieceHashes []handshake.Hash
	PieceLength int
	Length      int
	Name        string
}

TorrentFile stores the basic information to handle processing and download of torrents

func (*TorrentFile) BuildTrackerURL

func (t *TorrentFile) BuildTrackerURL(peerID [20]byte, port uint16) (string, error)

BuildTrackerURL takes the TorrentFile and build the tracker URL with params Example can be found on https://wiki.theory.org/BitTorrent_Tracker_Protocol For this implementation we are always passing as no parts have been downloaded yet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL