tracker

package
v0.0.0-...-1068d9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	InfoHash   common.InfoHash
	PeerID     common.PeerID
	Port       int
	Uploaded   uint64
	Downloaded uint64
	Left       uint64
	IP         common.Address
	NumWant    uint64
	Event      string
	// contains filtered or unexported fields
}

func MakeRequest

func MakeRequest(remoteAddr, infoHash, peerID, port, uploaded, downloaded, left, ip, numwant,
	event string, logger *log.Logger) (*Request, error)

func (*Request) Compact

func (self *Request) Compact() common.Address

func (*Request) CompactPeer

func (self *Request) CompactPeer() common.Peer

func (*Request) I2PHash

func (p *Request) I2PHash() common.Address

get base64 representation of i2p dest sha256 hash(the 44-character one)

func (*Request) Peer

func (self *Request) Peer() common.Peer

func (*Request) String

func (self *Request) String() string

func (*Request) TimeStampDelta

func (self *Request) TimeStampDelta() float64

type Response

type Response struct {
	Interval int           `bencode:"interval"`
	Peers    []common.Peer `bencode:"peers"`
}

func (*Response) Bencode

func (self *Response) Bencode() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL