The specific implementations of net.Addr are internal implementation details of this package, and a downstream consumner shouldn't relay on the internal use of net.IPAddr / net.TCPAddr to implement that interface for direct extraction of IP. The consumer would instead need to go through a round of string conversion to retreive IP safely. Adding an IP extraction function to the interface here will allow the IP to be retreived more efficiently.
go-multiaddr-net
Multiaddress net tools
This package provides Multiaddr specific versions of common functions in stdlib's net
package. This means wrappers of standard net symbols like net.Dial
and net.Listen
, as well
as conversion to and from net.Addr
.
Table of Contents
Install
go-multiaddr-net
is a standard Go module which can be installed with:
go get github.com/multiformats/go-multiaddr-net
Note that go-multiaddr-net
is packaged with Gx, so it is recommended to use Gx to install and use it (see Usage section).
Usage
See the docs:
multiaddr/net
: https://godoc.org/github.com/multiformats/go-multiaddr-netmultiaddr
: https://godoc.org/github.com/multiformats/go-multiaddr
Contribute
Contributions welcome. Please check out the issues.
Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS Code of Conduct.
Small note: If editing the README, please conform to the standard-readme specification.
License
MIT © 2014 Juan Batiz-Benet