util

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasIPv4 added in v0.22.0

func HasIPv4(addrs []netip.Addr) bool

HasIPv4 returns true if the list of addresses contains an IPv4 address.

func HasIPv6 added in v0.22.0

func HasIPv6(addrs []netip.Addr) bool

HasIPv6 returns true if the list of addresses contains an IPv6 address.

func ParseAddrList added in v0.22.0

func ParseAddrList(addrList []string) ([]netip.Addr, error)

ParseAddrList parses a list of IP address strings and returns a list of netip.Addr.

func ParseAddrPortList added in v0.22.0

func ParseAddrPortList(addrPortList []string) ([]netip.AddrPort, error)

ParseAddrPortList parses a list of IP address and port strings and returns a list of netip.AddrPort.

func PointerTo added in v0.22.0

func PointerTo[T any](v T) *T

PointerTo returns a pointer to the value v.

func Strings added in v0.22.0

func Strings[T fmt.Stringer](s []T) []string

Strings converts a slice of objects that implement fmt.Stringer to a slice of strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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