known

package
v0.0.0-...-8abdde7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int
const (
	None Kind = iota
	Tracker
	DHT
	PEX
	Heard
	Seen
	Active
	ActiveNoReset
	ConnectAttempt
	Good
	Bad
)

type Peer

type Peer struct {
	Addr               netip.AddrPort
	Id                 hash.Hash
	TrackerTime        time.Time
	DHTTime            time.Time
	PEXTime            time.Time
	HeardTime          time.Time
	SeenTime           time.Time
	ActiveTime         time.Time
	ConnectAttemptTime time.Time
	BadTime            time.Time
	Attempts           uint
	Badness            int
	Version            string
}

func Find

func Find(peers Peers, addr netip.AddrPort, id hash.Hash, version string, kind Kind) *Peer

func FindId

func FindId(peers Peers, id hash.Hash, addr netip.AddrPort) *Peer

func (*Peer) Bad

func (kp *Peer) Bad() bool

func (*Peer) ReallyBad

func (kp *Peer) ReallyBad() bool

func (*Peer) Recent

func (kp *Peer) Recent() bool

func (*Peer) Update

func (kp *Peer) Update(version string, kind Kind)

type Peers

type Peers map[netip.AddrPort]*Peer

func (Peers) Count

func (ps Peers) Count() int

func (Peers) Expire

func (ps Peers) Expire()

Jump to

Keyboard shortcuts

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