p2p

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBacklog = 5

MaxBacklog is the number of unfulfilled requests a client can have in its pipeline

View Source
const MaxBlockSize = 16384

MaxBlockSize is the largest number of bytes a request can ask for

Variables

This section is empty.

Functions

This section is empty.

Types

type Torrent

type Torrent struct {
	Peers       []peers.Peer
	PeerID      [20]byte
	InfoHash    [20]byte
	PieceHashes [][20]byte
	PieceLength int
	Length      int
	Name        string
}

Torrent holds data required to download a torrent from a list of peers

func (*Torrent) Download

func (t *Torrent) Download() ([]byte, error)

Download downloads the torrent. This stores the entire file in memory.

func (*Torrent) TotalSize

func (t *Torrent) TotalSize() int

Jump to

Keyboard shortcuts

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