peers

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr = inet256.Addr

type ChainStore

type ChainStore[T p2p.Addr] []Store[T]

func (ChainStore[T]) Add

func (ps ChainStore[T]) Add(inet256.Addr)

func (ChainStore[T]) Contains

func (ps ChainStore[T]) Contains(id inet256.Addr) bool

func (ChainStore[T]) ListAddrs

func (ps ChainStore[T]) ListAddrs(id inet256.Addr) []T

func (ChainStore[T]) ListPeers

func (ps ChainStore[T]) ListPeers() []inet256.Addr

func (ChainStore[T]) Remove

func (ps ChainStore[T]) Remove(inet256.Addr)

func (ChainStore[T]) SetAddrs

func (ps ChainStore[T]) SetAddrs(x inet256.Addr, addrs []T)

type Set

type Set interface {
	ListPeers() []Addr
	Contains(Addr) bool
}

PeerSet represents a set of peers

type Store

type Store[T p2p.Addr] interface {
	Add(x Addr)
	Remove(x Addr)
	SetAddrs(x Addr, addrs []T)
	ListAddrs(x Addr) []T

	Set
}

PeerStore stores information about peers TA is the type of the transport address

func NewStore

func NewStore[T p2p.Addr]() Store[T]

Jump to

Keyboard shortcuts

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