Versions in this module Expand all Collapse all v1 v1.2.0 Dec 31, 2023 v1.1.0 Dec 31, 2023 Changes in this version + type Bitfield []byte + func (b Bitfield) HasPiece(index int) bool + func (b Bitfield) SetPiece(index int) + type Client struct + Bitfield Bitfield + Choked bool + Conn net.Conn + func NewClient(peer peer.Peer, peerID handshake.PeerID, infoHash handshake.Hash) (*Client, error) + func (c *Client) Read() (message.Message, error) + func (c *Client) SendHave(index int) error + func (c *Client) SendInterested() error + func (c *Client) SendNotInterested() error + func (c *Client) SendRequest(index, begin, length int) error + func (c *Client) SendUnchoke() error + type Torrent struct + InfoHash handshake.Hash + Length int + Name string + PeerID handshake.PeerID + Peers []peer.Peer + PieceHashes []handshake.Hash + PieceLength int + func TorrentFromTorrentFile(tFile string) (Torrent, error) + func (t *Torrent) Download(path string) error