addrlist

package
v1.8.10 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 8 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, blocklist *blocklist.Blocklist, listenPort int, clientIP *net.IP) *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 added in v0.2.0

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() (*net.TCPAddr, peersource.Source)

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

func (*AddrList) Push

func (d *AddrList) Push(addrs []*net.TCPAddr, 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.

Jump to

Keyboard shortcuts

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