autopeering

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PublicPeers string

Functions

func GetClosestPeers

func GetClosestPeers(peerList []url.URL, n int) []url.URL

Get n online peers with best latency from a peer list

func GetPublicPeers

func GetPublicPeers() []url.URL

Get URLs of embedded public peers

func RandomPick

func RandomPick(peerList []url.URL, n int) []url.URL

Pick n random peers from a list

Types

type AutoPeering

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

func (*AutoPeering) Init

func (ap *AutoPeering) Init(yggcore *core.Core, yggConfig *config.NodeConfig, popConfig *popura.PopuraConfig, log *log.Logger, options interface{}) error

func (*AutoPeering) IsStarted

func (ap *AutoPeering) IsStarted() bool

func (*AutoPeering) SetupAdminHandlers

func (ap *AutoPeering) SetupAdminHandlers(a *admin.AdminSocket)

func (*AutoPeering) Start

func (ap *AutoPeering) Start() error

func (*AutoPeering) Stop

func (ap *AutoPeering) Stop() error

func (*AutoPeering) UpdateConfig

func (ap *AutoPeering) UpdateConfig(yggConfig *config.NodeConfig, popConfig *popura.PopuraConfig)

type Peer

type Peer struct {
	URL     url.URL
	Online  bool
	Latency time.Duration
}

Jump to

Keyboard shortcuts

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