peer_store

package
v2.0.0-...-9844042 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemory

type InMemory struct {
	// This is used for sorting infohashes by distance in WriteDebug.
	RootId int160.T
	// contains filtered or unexported fields
}

func (*InMemory) AddPeer

func (me *InMemory) AddPeer(ih InfoHash, na krpc.NodeAddr)

func (*InMemory) GetAll

func (me *InMemory) GetAll() (ret map[InfoHash][]NodeAndTime)

func (*InMemory) GetPeers

func (me *InMemory) GetPeers(ih InfoHash) (ret []krpc.NodeAddr)

func (*InMemory) WriteDebug

func (me *InMemory) WriteDebug(w io.Writer)

type InfoHash

type InfoHash = metainfo.Hash

type Interface

type Interface interface {
	AddPeer(InfoHash, krpc.NodeAddr)
	GetPeers(InfoHash) []krpc.NodeAddr
}

type NodeAndTime

type NodeAndTime struct {
	krpc.NodeAddr
	time.Time
}

Jump to

Keyboard shortcuts

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