small doc fixes

[skip ci]
This commit is contained in:
Jimmy Zelinskie 2015-10-31 16:55:20 -04:00
parent 522e874336
commit 85e08f986e

View file

@ -79,13 +79,14 @@ func (pk PeerKey) PeerID() string {
} }
// Endpoint is an IP and port pair. // Endpoint is an IP and port pair.
//
// IP always has length net.IPv4len if IPv4, and net.IPv6len if IPv6.
type Endpoint struct { type Endpoint struct {
// Always has length net.IPv4len if IPv4, and net.IPv6len if IPv6
IP net.IP `json:"ip"` IP net.IP `json:"ip"`
Port uint16 `json:"port"` Port uint16 `json:"port"`
} }
// Peer is a participant in a swarm. // Peer represents a participant in a BitTorrent swarm.
type Peer struct { type Peer struct {
ID string `json:"id"` ID string `json:"id"`
UserID uint64 `json:"userId"` UserID uint64 `json:"userId"`
@ -114,7 +115,7 @@ func (p *Peer) Key() PeerKey {
return NewPeerKey(p.ID, p.IP) return NewPeerKey(p.ID, p.IP)
} }
// Torrent is a swarm for a given torrent file. // Torrent represents a BitTorrent swarm and its metadata.
type Torrent struct { type Torrent struct {
ID uint64 `json:"id"` ID uint64 `json:"id"`
Infohash string `json:"infohash"` Infohash string `json:"infohash"`