Documentation ¶
Index ¶
Constants ¶
View Source
const ( ANNOUNCEURLKIND_DHT = iota ANNOUNCEURLKIND_UDP = iota ANNOUNCEURLKIND_HTTP = iota )
Variables ¶
View Source
var ( ERR_ANNOUNCEURL = errors.New("ERR_ANNOUNCEURL") ERR_QUERY_ANNOUNCE = errors.New("ERR_QUERY_ANNOUNCE") )
Functions ¶
This section is empty.
Types ¶
type AnnounceHandshakeParams ¶
type AnnounceHandshakeParams struct { InfoHash string PeerId string Port string Uploaded string Downloaded string Left string Event string }
func GetAnnounceHandshakeParams ¶
func GetAnnounceHandshakeParams(myMetainfo *metainfo.MetaInfo, myPeerId [20]byte) (AnnounceHandshakeParams, error)
type AnnounceUrl ¶
type AnnounceUrl struct {
// contains filtered or unexported fields
}
func NewAnnounceUrl ¶
func NewAnnounceUrl(url string) (*AnnounceUrl, error)
type AnnounceUrlResponse ¶
type AnnounceUrlResponse struct { FailureReason string `bencode:"failure reason"` Interval int32 `bencode:"interval"` TrackerId string `bencode:"tracker id"` Complete int32 `bencode:"complete"` Incomplete int32 `bencode:"incomplete"` Peers peer.Peers `bencode:"peers"` }
func GetPeers ¶
func GetPeers(myMetainfo *metainfo.MetaInfo, myPeerId [20]byte) (*AnnounceUrlResponse, error)
func QueryAnnounceUrls ¶
func QueryAnnounceUrls(announceUrls []string, handshakeParams AnnounceHandshakeParams) (*AnnounceUrlResponse, error)
QueryAnnounceUrls takes 'announceUrls' and queries them with 'handshakeParams' synchronously until one responds. If we get one good response, it is decoded (through bencode), marshalled and returned
Click to show internal directories.
Click to hide internal directories.