tracker

package
Version: v0.0.0-...-f34eb16 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompactResponse

type CompactResponse struct {
	ResponseBase
	Peers  []byte
	Peers6 []byte
}

func (*CompactResponse) Convert

func (cr *CompactResponse) Convert() *Response

type Peer

type Peer struct {
	PeerID string
	IP     string
	Port   uint16
}

func (*Peer) Hash

func (p *Peer) Hash() string

func (*Peer) String

func (p *Peer) String() string

type PeerPool

type PeerPool struct {
	// contains filtered or unexported fields
}

func NewPeerPool

func NewPeerPool() *PeerPool

func (*PeerPool) Add

func (pp *PeerPool) Add(p *Peer)

func (*PeerPool) GetPeers

func (pp *PeerPool) GetPeers() []*Peer

func (*PeerPool) String

func (pp *PeerPool) String() string

type Response

type Response struct {
	ResponseBase
	Peers []*Peer
}

func ParseResponse

func ParseResponse(resp []byte) (*Response, error)

type ResponseBase

type ResponseBase struct {
	FailureReason  string
	WarningMessage string
	Interval       uint64
	MinInterval    uint64
	TrackerID      string
	Complete       uint32
	Incomplete     uint32
}

func (*ResponseBase) GetInterval

func (rb *ResponseBase) GetInterval(min bool) uint64

func (*ResponseBase) Leechers

func (rb *ResponseBase) Leechers() uint32

func (*ResponseBase) Seeders

func (rb *ResponseBase) Seeders() uint32

type TrackerClientCollection

type TrackerClientCollection struct {
	// contains filtered or unexported fields
}

func (*TrackerClientCollection) RequestPeers

func (tc *TrackerClientCollection) RequestPeers(downloaded, uploaded, left uint64) (seedernum uint32, leechernum uint32, peers *PeerPool)

Jump to

Keyboard shortcuts

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