util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDLength = 16

IDLength is here as a variable so that it can be decreased for tests with mocknet where IDs are way shorter. The call to FmtPeerID would panic if this value stayed at 16.

Functions

func ContainsPublicAddr

func ContainsPublicAddr(addrs []ma.Multiaddr) bool

func DefaultGatewayHTML added in v0.6.0

func DefaultGatewayHTML(ctx context.Context) (string, error)

DefaultGatewayHTML discovers the default gateway address and fetches the home HTML page to get a sense which router is used.

func ExtractRelayMaddr added in v0.6.0

func ExtractRelayMaddr(maddr ma.Multiaddr) (*peer.AddrInfo, error)

func FmtPeerID

func FmtPeerID(id peer.ID) string

func IsRelayedMaddr

func IsRelayedMaddr(maddr ma.Multiaddr) bool

func SupportDCUtR

func SupportDCUtR(protocols []string) bool

func Unique added in v0.3.0

func Unique[T comparable](input []T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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