routing

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package routing implements the PeerRouting interface by computing the remote peer's wireguard address from its public key.

Index

Constants

This section is empty.

Variables

View Source
var PublicKeyRouter = func(host.Host) (routing.PeerRouting, error) {
	return FindPeerFunc(FindPeer), nil
}

PublicKeyRouter is a PeerRouting implementation that computes the remote peer's wireguard address from its public key.

Functions

func FindPeer

func FindPeer(ctx context.Context, id peer.ID) (peer.AddrInfo, error)

FindPeer computes the remote peer's wireguard address from its public key. It assumes the port used for endpoint signaling in the returned results.

Types

type FindPeerFunc

type FindPeerFunc func(ctx context.Context, id peer.ID) (peer.AddrInfo, error)

FindPeerFunc wraps a function and implements the PeerRouting interface.

func (FindPeerFunc) FindPeer

func (f FindPeerFunc) FindPeer(ctx context.Context, id peer.ID) (peer.AddrInfo, error)

FindPeer implements the PeerRouting interface.

Jump to

Keyboard shortcuts

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