common

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DiscProto     = "/disc/0.1"
	IdentityProto = "/id/0.1"
)
View Source
const DNSRegex = `^/?(dns)(4|6)?/[^-|^/][A-Za-z0-9-]([^-|^/]?)+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Za-z]{2,}(/?)$`

DNSRegex is a regex string to match against a valid dns/dns4/dns6 addr

Variables

This section is empty.

Functions

func AddrInfoToString

func AddrInfoToString(addr *peer.AddrInfo) (string, error)

AddrInfoToString converts an AddrInfo into a string representation that can be dialed from another node

func MultiAddrFromDNS

func MultiAddrFromDNS(addr string, port int) (multiaddr.Multiaddr, error)

MultiAddrFromDNS constructs a multiAddr from the passed in DNS address and port combination

func StringToAddrInfo

func StringToAddrInfo(addr string) (*peer.AddrInfo, error)

Types

type DialPriority

type DialPriority uint64
const (
	PriorityRequestedDial DialPriority = 1
	PriorityRandomDial    DialPriority = 10
)

Jump to

Keyboard shortcuts

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