Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inetaf/netaddr
Network address types
https://github.com/inetaf/netaddr
Last synced: about 1 month ago
JSON representation
Network address types
- Host: GitHub
- URL: https://github.com/inetaf/netaddr
- Owner: inetaf
- License: bsd-3-clause
- Archived: true
- Created: 2020-03-30T20:36:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-25T18:44:39.000Z (over 1 year ago)
- Last Synced: 2024-08-02T15:48:01.379Z (4 months ago)
- Language: Go
- Size: 337 KB
- Stars: 713
- Watchers: 22
- Forks: 43
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
- go-awesome - netaddr - Processing of network addresses (Open source library / The Internet)
README
# netaddr [![Test Status](https://github.com/inetaf/netaddr/workflows/Linux/badge.svg)](https://github.com/inetaf/netaddr/actions) [![Go Reference](https://pkg.go.dev/badge/inet.af/netaddr.svg)](https://pkg.go.dev/inet.af/netaddr)
## Deprecated
Please see https://pkg.go.dev/go4.org/netipx and the standard library's
[`net/netip`](https://pkg.go.dev/net/netip).## What
This is a package containing a new IP address type for Go.
See its docs: https://pkg.go.dev/inet.af/netaddr
## Status
This package is mature, optimized, and used heavily in production at [Tailscale](https://tailscale.com).
However, API stability is not yet guaranteed.netaddr is intended to be a core, low-level package.
We take code review, testing, dependencies, and performance seriously, similar to Go's standard library or the golang.org/x repos.## Motivation
See https://tailscale.com/blog/netaddr-new-ip-type-for-go/ for a long
blog post about why we made a new IP address package.Other links:
* https://github.com/golang/go/issues/18804 ("net: reconsider representation of IP")
* https://github.com/golang/go/issues/18757 ("net: ParseIP should return an error, like other Parse functions")
* https://github.com/golang/go/issues/37921 ("net: Unable to reliably distinguish IPv4-mapped-IPv6 addresses from regular IPv4 addresses")
* merges net.IPAddr and net.IP (which the Go net package is a little torn between for legacy reasons)## Testing
In addition to regular Go tests, netaddr uses fuzzing.
The corpus is stored separately, in a submodule,
to minimize the impact on everyone else.To use:
```
$ git submodule update --init
$ go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
$ go-fuzz-build && go-fuzz
```