common

package
v0.0.0-...-5839da9 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

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

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