netutil

package
v0.0.0-...-08b9edc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNS             = errorx.NewNamespace("net_util")
	ErrInvalidAddress = ErrNS.NewType("invalid_address")
)

Functions

func ParseHostAndPortFromAddress

func ParseHostAndPortFromAddress(address string) (string, uint, error)

ParseHostAndPortFromAddress parse an address in format `host:port` like `127.0.0.1:2379`. Returns error if parse failed.

func ParseHostAndPortFromAddressURL

func ParseHostAndPortFromAddressURL(urlString string) (string, uint, error)

ParseHostAndPortFromAddressURL parse an address in format `protocol://ip:port/...` like `http://127.0.0.1:2379`. Returns error if parse failed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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