peer_store

package
v2.0.0-...-be9fe6b Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

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