ipv6

package
v0.0.0-...-281492b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotIPv6   = errors.New("not an IPv6 address")
	ErrInvalidIP = errors.New("invalid IP address")
)

Functions

func DefaultConfig

func DefaultConfig() fltrie.Config

DefaultConfig returns the standard FlashTrie config for IPv6.

func ParseCIDR

func ParseCIDR(cidr string) (string, error)

ParseCIDR converts an IPv6 CIDR string to a binary prefix string for fltrie.Add. IPv4-mapped IPv6 addresses are rejected.

Types

type Adapter

type Adapter struct{}

Adapter implements fltrie.Adapter[netip.Addr] for IPv6 lookups.

func NewAdapter

func NewAdapter() Adapter

NewAdapter creates a new IPv6 adapter.

func (Adapter) Encode

func (Adapter) Encode(addr netip.Addr) (string, error)

Encode converts an IPv6 address to a 128-bit binary string. IPv4-mapped IPv6 addresses (e.g. ::ffff:1.2.3.4) are rejected.

func (Adapter) KeyBits

func (Adapter) KeyBits() uint

KeyBits returns 128 for IPv6.

Jump to

Keyboard shortcuts

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