Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotConnected = errors.New("not connected") ErrBadScheme = errors.New("unknown scheme") )
Functions ¶
Types ¶
type AnnounceEvent ¶
type AnnounceEvent int32
const ( None AnnounceEvent = iota Completed // The local peer just completed the torrent. Started // The local peer has just resumed this torrent. Stopped // The local peer is leaving the swarm. )
func (AnnounceEvent) String ¶
func (me AnnounceEvent) String() string
type AnnounceRequest ¶
type AnnounceRequest struct { InfoHash [20]byte PeerId [20]byte Downloaded int64 Left uint64 Uploaded int64 Event AnnounceEvent IPAddress int32 Key int32 NumWant int32 // How many peer addresses are desired. -1 for default. Port uint16 } // 82 bytes
Marshalled as binary by the UDP client, so be careful making changes.
type AnnounceResponse ¶
type AnnounceResponseHeader ¶
type Client ¶
type Client interface { // Returns ErrNotConnected if Connect needs to be called. Announce(*AnnounceRequest) (AnnounceResponse, error) Connect() error String() string URL() string }
type ConnectionRequest ¶
type ConnectionResponse ¶
type ConnectionResponse struct {
ConnectionId int64
}
type RequestHeader ¶
type ResponseHeader ¶
Click to show internal directories.
Click to hide internal directories.