addr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: AGPL-3.0 Imports: 5 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

This section is empty.

Variables

View Source
var HostColonPortPattern = regexp.MustCompile(`^[-a-zA-Z0-9.]+:\d+$`)

HostColonPortPattern matches "^[-a-zA-Z0-9.]+:\\d+$" e.g. "foo.com.:1234"

Functions

func IsMultiaddr

func IsMultiaddr(addr string) bool

IsMultiaddr returns true if the provided string is a valid multiaddr.

func ParseHostOrURL

func ParseHostOrURL(addr string) (*url.URL, error)

ParseHostOrURL handles "host:port" or a full URL. Standard library net/url.Parse chokes on "host:port".

func ParseHostOrURLOrMultiaddr

func ParseHostOrURLOrMultiaddr(addr string) (string, error)

ParseHostOrURLOrMultiaddr returns an error if it could not parse the provided string as a valid "host:port", full URL, or multiaddr. If no error, it returns a host:port address, or a multiaddr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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