Releases: AdguardTeam/golibs
v0.12.1
v0.12.0
Added
- Function
netutil.ValidateTLDLabel
which validates label of a name as if it's a top-level domain. - Functions
netutil.ValidateHostname
andnetutil.ValidateHostnameLabel
. - New error type
netutil.LabelError
which is returned by label validation functions. - New
LabelKind
type alias of string and the set of constants describing different types of name labels.
Changed
- Function
netutil.ValidateDomainName
now validates over less strict set of rules (according to the second section of RFC 3696). Consider replacing it withnetutil.ValidateHostname
everywhere the LDH (letters, digits, hyphens) rule is desired. - All the name validation functions now treat last label a TLD (top-level domain), validating it correspondingly.
- Type
AddrKind
is now a type alias for string.
v0.11.4
v0.11.2
v0.11.1
v0.11.0
Added
-
The
netutil.AddrFamily
type. -
netutil.IPv4Localhost
andnetutil.IPv6Localhost
returning correspondingnetip.Addr
values. -
netutil.ZeroPrefix
returning an empty subnet for the specified protocol version. -
netutil.IPToAddr
andnetutil.IPToAddrNoMapped
for conversion fromnet.IP
tonetip.Addr
. -
netutil.IPNetToPrefix
andnetutil.IPNetToPrefixNoMapped
for conversion fromnet.IPNet
tonetip.Prefix
.
Changed
- Go version has been updated to Go 1.18.
Deprecated
netutil.CloneMAC
,netutil.CloneIP
,netutil.IPMap
,netutil.IPPort
.
v0.10.9
Added
- Functions
log.Panic
andlog.Panicf
.
Changed
- Function
testutil.AssertErrorMsg
now doesn't terminate the test in case of failure.
v0.10.8
Added
-
New
netutil.SubnetSet
type that checks an IP address for being contained by a set of IP networks. -
New
netutil.SliceSubnetSet
,netutil.SubnetSetFunc
helper types implementing thenetutil.SubnetSet
. -
New
netutil.ParseSubnets
function which wraps thenetutil.ParseSubnet
to accept several strings. -
New
netutil.IsLocallyServed
andnetutil.IsSpecialPurpose
checking an IP address for being contained by some well-known networks.
v0.10.7
v0.10.6
Added
- Function
netutil.CloneIPNet
that returns a deep clone of an IP network.