Documentation
¶
Index ¶
- Variables
- func AnnouncementReply(msg Message, torrent_list map[string][]Peer) []byte
- func ConnectionReply(msg Message, connId uint64) []byte
- func ErrorReply(msg Message, errorMessage string) []byte
- func GetMessage(connection *net.UDPConn, messageChannel chan<- Message, ...)
- func ScrapingReply(msg Message, torrent_list map[string][]Peer) []byte
- type Message
- func (m Message) Action() []byte
- func (m Message) AllInfoHash() []Torrent
- func (m Message) ConnectionId() uint64
- func (m Message) Contents() []byte
- func (m Message) Downloaded() []byte
- func (m Message) Event() []byte
- func (m Message) IPAddr() ([]byte, error)
- func (m Message) InfoHash() []byte
- func (m Message) Key() []byte
- func (m Message) Left() []byte
- func (m Message) Magic() []byte
- func (m Message) NumWant() []byte
- func (m Message) PeerId() []byte
- func (m Message) Port() []byte
- func (m Message) TransactionId() []byte
- func (m Message) Uploaded() []byte
- type NoIPAddrError
- type Peer
- type Torrent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CONNECT []byte = []byte{0, 0, 0, 0} ANNOUNCE []byte = []byte{0, 0, 0, 1} SCRAPE []byte = []byte{0, 0, 0, 2} ERROR []byte = []byte{0, 0, 0, 3} )
View Source
var ( NONE []byte = []byte{0, 0, 0, 0} COMPLETED []byte = []byte{0, 0, 0, 1} STARTED []byte = []byte{0, 0, 0, 2} STOPPED []byte = []byte{0, 0, 0, 3} )
View Source
var MAGIC []byte = []byte{0, 0, 4, 23, 39, 16, 25, 128}
Functions ¶
func ConnectionReply ¶
func ErrorReply ¶
func GetMessage ¶
Types ¶
type Message ¶
type Message struct { Length int Addr *net.UDPAddr Flags int // contains filtered or unexported fields }
func (Message) AllInfoHash ¶
func (Message) ConnectionId ¶
func (Message) Downloaded ¶
func (Message) TransactionId ¶
type NoIPAddrError ¶
type NoIPAddrError struct{}
func (NoIPAddrError) Error ¶
func (e NoIPAddrError) Error() string
type Peer ¶
func (*Peer) Initialize ¶
Click to show internal directories.
Click to hide internal directories.