Documentation
¶
Overview ¶
Package sqlip provides database/sql Scanner/Valuer types for IP data. Standard library only — works with any driver (pgx stdlib, lib/pq, go-sql-driver/mysql, sqlite).
- Addr: PostgreSQL inet (host), or any text column.
- Prefix: PostgreSQL cidr/inet (network), or any text column.
- BinaryAddr: MySQL VARBINARY(16) / INET6_ATON form (4 or 16 bytes).
The zero value of each type maps to SQL NULL. Scanned addresses are normalized (IPv4-mapped IPv6 unmapped).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addr ¶
Addr is a nullable IP address stored as text.
type BinaryAddr ¶
BinaryAddr is a nullable IP address stored as 4 (IPv4) or 16 (IPv6) bytes.
func (*BinaryAddr) Scan ¶
func (b *BinaryAddr) Scan(src any) error
Scan accepts NULL or exactly 4 or 16 raw bytes.
Click to show internal directories.
Click to hide internal directories.