addrlist

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrList

type AddrList struct {
	// contains filtered or unexported fields
}

AddrList contains peer addresses that are ready to be connected.

func New

func New(maxItems int, clientPeer *peer.AddrInfo) *AddrList

New returns a new AddrList.

func (*AddrList) Len

func (d *AddrList) Len() int

Len returns the number of addresses in the list.

func (*AddrList) LenSource

func (d *AddrList) LenSource(s peersource.Source) int

LenSource returns the number of addresses for a single source.

func (*AddrList) Pop

func (d *AddrList) Pop() (*peer.AddrInfo, peersource.Source)

Pop returns the next address. The returned address is removed from the list.

func (*AddrList) Push

func (d *AddrList) Push(addrs []*peer.AddrInfo, source peersource.Source)

Push adds a new address to the list. Does nothing if the address is already in the list.

func (*AddrList) Reset

func (d *AddrList) Reset()

Reset empties the address list.

func (*AddrList) ToAddrs

func (d *AddrList) ToAddrs(addrs []peer.AddrInfo) []*peer.AddrInfo

Jump to

Keyboard shortcuts

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