Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventStarted = "started" EventCompleted = "completed" EventStopped = "stopped" )
Variables ¶
This section is empty.
Functions ¶
func CalculateSha1 ¶
func PingTracker ¶
Types ¶
type Info ¶
type Info struct { Name string `bencode:"name"` PieceLength int `bencode:"piece length"` Pieces string `bencode:"pieces"` Length int `bencode:"length"` //length of the file in bytes Files []File `bencode:"files"` Private int `bencode:"private"` Entropy string `bencode:"entropy"` Source string `bencode:"source"` XCrossSeed string `bencode:"x cross seed"` }
type Peer ¶
type Peer struct { // does not appear in compact mode ID string `bencode:"peer id"` // 20 bytes + 3 bytes bencoding overhead IP net.IP `bencode:"ip"` // max 225 bytes + 4bytes bencoding overhead Port uint16 `bencode:"port"` // max 7 bytes + }
comapct form - each peer is represented using only 6 bytes first 4 byte contain the 32-bit ipv4 address last 2 byte contain the port number network byte order is used
func ParsePeerList ¶
func ParsePeerList(tr TrackerResponse) []Peer
type Torrent ¶
type Torrent struct { Announce string `bencode:"announce"` AnnounceList []interface{} `bencode:"announce-list"` Comment string `bencode:"comment"` CreationDate int `bencode:"creation date"` InfoByte []byte `bencode:"info"` Info Info HTTPSeeds []interface{} `bencode:"http seeds"` Checksum string `bencode:"checksum"` CreatedBy string `bencode:"created by"` Encoding string `bencode:"encoding"` }
type TrackerRequest ¶
type TrackerRequest struct {
// contains filtered or unexported fields
}
type TrackerResponse ¶
type TrackerResponse struct { FailureReason string `bencode:"failureReason"` Interval int `bencode:"interval"` PeerData string `bencode:"peers"` Peers []Peer }
func ParseTrackerResponse ¶
func ParseTrackerResponse(b []byte) TrackerResponse
Click to show internal directories.
Click to hide internal directories.