Documentation ¶
Overview ¶
http://www.bittorrent.org/beps/bep_0009.html http://www.bittorrent.org/beps/bep_0010.html
Index ¶
- Constants
- func Atoi64(b []byte) uint64
- func Decode(data []byte, v interface{}) error
- func Encode(data interface{}) (string, error)
- func ErrStr(e error) string
- func GetProcAbsDir() (string, error)
- func GetRandString(size int) string
- func I64toA(i uint64) []byte
- type Config
- type DHT
- type Peer
- type Request
- type Response
- type Wire
Constants ¶
View Source
const ( // REQUEST represents request message type REQUEST = iota // DATA represents data message type DATA // REJECT represents reject message type REJECT )
View Source
const ( // BLOCK is 2 ^ 14 // The metadata is handled in blocks of 16KiB (16384 Bytes). The metadata blocks are indexed starting at 0. All blocks are 16KiB except the last block which may be smaller. BLOCK = 16384 // MaxMetadataSize represents the max medata it can accept MaxMetadataSize = BLOCK * 1000 // EXTENDED represents it is a extended message EXTENDED = 20 // HANDSHAKE represents handshake bit HANDSHAKE = 0 )
Variables ¶
This section is empty.
Functions ¶
func GetProcAbsDir ¶
GetProcAbsDir returns the current process's folder path
func GetRandString ¶
GetRandString returns a size length random string
Types ¶
type Config ¶
type Config struct { // the size of nodes in response K int }
Config defines the configuration of a dht listener.
type DHT ¶
type Peer ¶
Peer represents a peer contact.
func (*Peer) CompactIPPortInfo ¶
CompactIPPortInfo returns "Compact node info". See http://www.bittorrent.org/beps/bep_0005.html.
type Wire ¶
type Wire struct {
// contains filtered or unexported fields
}
Wire represents the wire protocol.
func NewWire ¶
NewWire returns a Wire pointer.
- requestQueueSize: the max requests it can buffers
- workerQueueSize: the max goroutine downloading workers
Source Files ¶
Click to show internal directories.
Click to hide internal directories.