ip

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ip provides IP address related functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHostname

func FormatHostname(hostname string) string

Add brackets based on whether the given string is IPv6 or not. If the input is an IPv6 address, wraps it in square brackets `[ ]`. Otherwise, it returns the input string as-is (for domain names or IPv4 addresses).

func IsIPv6Only

func IsIPv6Only(ips []net.IP) bool

IsIPv6Only returns true if all given IPs are IPv6

func SliceToString

func SliceToString(ips []net.IP) string

SliceToString converts []net.IP to a string separated by comma. If the separator is empty, it defaults to ",".

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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