addr

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrWithDefaultLocalhost

func AddrWithDefaultLocalhost(addr string) (string, error)

AddrWithDefaultLocalhost returns addr with the host set to localhost if it is empty.

func NewAddrSetter

func NewAddrSetter(hostOption, portOption *string) pflag.Value

NewAddrSetter creates a new pflag.Value raps a address/port configuration option pair and enables setting them both with a single command-line flag.

func NewPortRangeSetter

func NewPortRangeSetter(lower, upper *int) pflag.Value

NewPortRangeSetter creates a new pflag.Value that allows setting a lower and upper bound of a port range with a single setting.

func SplitHostPort

func SplitHostPort(v string, defaultPort string) (addr string, port string, err error)

SplitHostPort is like net.SplitHostPort however it supports addresses without a port number. In that case, the provided port number is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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