Tracker doc
This commit is contained in:
parent
5f093c3803
commit
99d2ced31c
|
@ -15,12 +15,12 @@ type AnnounceRequest struct {
|
||||||
Event AnnounceEvent
|
Event AnnounceEvent
|
||||||
IPAddress int32
|
IPAddress int32
|
||||||
Key int32
|
Key int32
|
||||||
NumWant int32
|
NumWant int32 // How many peer addresses are desired. -1 for default.
|
||||||
Port int16
|
Port int16
|
||||||
}
|
}
|
||||||
|
|
||||||
type AnnounceResponse struct {
|
type AnnounceResponse struct {
|
||||||
Interval int32
|
Interval int32 // Minimum seconds the local peer should wait before next announce.
|
||||||
Leechers int32
|
Leechers int32
|
||||||
Seeders int32
|
Seeders int32
|
||||||
Peers []Peer
|
Peers []Peer
|
||||||
|
@ -35,12 +35,13 @@ type Peer struct {
|
||||||
|
|
||||||
const (
|
const (
|
||||||
None AnnounceEvent = iota
|
None AnnounceEvent = iota
|
||||||
Completed
|
Completed // The local peer just completed the torrent.
|
||||||
Started
|
Started // The local peer has just resumed this torrent.
|
||||||
Stopped
|
Stopped // The local peer is leaving the swarm.
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client interface {
|
type Client interface {
|
||||||
|
// Returns ErrNotConnected if Connect needs to be called.
|
||||||
Announce(*AnnounceRequest) (AnnounceResponse, error)
|
Announce(*AnnounceRequest) (AnnounceResponse, error)
|
||||||
Connect() error
|
Connect() error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue