peers

package
v0.0.0-...-287ff3b Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalPeerID

func GetLocalPeerID() [20]byte

Types

type Peer

type Peer struct {
	IP   net.IP
	Port uint16
}

func Unmarshal

func Unmarshal(peers []byte) ([]Peer, error)

Unmarshal parse the byte list to peer list 6 byte for one peer 4 byte for IP 2 byte for Port

func (Peer) String

func (p Peer) String() string

type TrackerResponse

type TrackerResponse struct {
	Interval int    `bencode:"interval"`
	Peers    string `bencode:"peers"`
}

Jump to

Keyboard shortcuts

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