internal/ipv6host
import "github.com/gofiber/fiber/v3/internal/ipv6host"
Package ipv6host writes IPv6 hosts in the one form browsers serialize them in, so that every spelling of an address (RFC 4291 Section 2.2) compares equal.
Functions
func Canonical(host string) string
Source: internal/ipv6host/ipv6host.go:45
Canonical rewrites the bracketed IPv6 address that host starts with, as in "[0:0:0:0:0:0:0:1]:3000", and returns anything else unchanged.
func Parse(s string) (netip.Addr, bool)
Source: internal/ipv6host/ipv6host.go:15
Parse parses an IPv6 address written without brackets. A zone is refused: netip copies it, and Unmap would drop it.
func String(addr netip.Addr, raw string) string
Source: internal/ipv6host/ipv6host.go:25
String writes addr as the WHATWG URL serializer does: RFC 5952 Section 4, and an IPv4-mapped tail in hex ("::ffff:7f00:1"). raw is returned when it already is that form, so the common case does not allocate.