57 Commits

Author SHA1 Message Date
Steven Allen
020c4d1741 test: empty multiaddr 2019-05-20 12:28:10 -07:00
Steven Allen
e3951368fb forbid empty multiaddrs
fixes #104
2019-05-20 12:23:28 -07:00
idk
672c39fb9b add comments and don't repeat myself as much 2019-04-05 20:51:42 -04:00
idk
71e227b59a correct the protocol codes for garlic addresses 2019-04-05 15:15:05 -04:00
idk
d75a9913ac add a test for base32's longer than 56 chars 2019-03-29 17:45:22 -04:00
idk
d288e979d6 variable-length garlic32 addresses 2019-03-29 14:52:24 -04:00
Hector Sanjuan
0aa80854ab Let Multiaddr implement marshalers: binary, text, json 2019-02-25 22:48:24 +00:00
backkem
6b421eaeda Add p2p-webrtc-direct protocol 2018-12-20 12:10:18 +01:00
idk
b0582d3730
make suggested changes, pre-compute garlicBase64Encoding, simplify garlicValidate, check length of bytes 2018-12-18 10:22:35 -05:00
idk
567daf242f
made garlic64 variable-length 2018-12-13 04:53:17 -05:00
idk
0f1c1ba00d
remove garlic32 protocol 2018-11-30 22:48:29 -05:00
idk
a91caf054e
add both base64 and base32 addresses as separate protocols, remove port from addresses to be expressed as /tcp, etc. 2018-11-30 19:55:52 -05:00
idk
789405bd40
remove log 2018-11-27 18:17:51 -05:00
idk
fb27f336e7
better test message for failure to convert x to y 2018-11-27 12:58:26 -05:00
idk
01a9048ee5
re-enable the tests 2018-11-27 12:53:46 -05:00
idk
54ddf83b00
Switch to using base64 i2p addresses to facilitate transport 2018-11-26 05:03:37 -05:00
idk
58c18c3ad6
Switch to using base64 i2p addresses to facilitate transport 2018-11-25 15:27:27 -05:00
idk
cf7ed7c1ad
created onionv3 and garlic multiaddrs 2018-11-15 04:11:07 -05:00
Steven Allen
96897075ba fix path test
Opinionated: Paths should start with /, dammit!
2018-10-01 22:05:11 -07:00
Steven Allen
0f158f1163 nit: mark test helper 2018-10-01 16:56:58 -07:00
Steven Allen
61e31ed48b stop copying when calling Bytes
This is a huge performance hit. Really, we just need to tell users not to modify
the result.

Also, get rid of an unnecessary pointer indirection (no api change).
2018-10-01 16:56:57 -07:00
Steven Allen
41068aa69c correctly format ip4-in-6 addresses
fixes part one of #77
2018-09-30 16:41:00 -07:00
mwnx
1f9df061aa Add "zone" multiaddr (IPv6 zone)
See [rfc4007].

Can be prefixed to "ip6" like so:

    /zone/eth0/ip6/fe80::1

This corresponds to the rfc4007 address `fe80::1%eth0`

[rfc4007] https://tools.ietf.org/html/rfc4007
2018-09-14 18:41:48 -07:00
Steven Allen
1e80322cf0 add test case for panic 2018-06-22 13:29:31 -07:00
Steven Allen
7f59fc3f88 add tests for /p2p addrs 2018-06-18 18:31:18 -07:00
Steven Allen
a778a9db10 add a round-trip test 2018-06-18 18:27:39 -07:00
Jeromy
dea70a9f19 begin transition from /ipfs/ to /p2p/ multiaddrs 2018-06-18 18:24:36 -07:00
Lars Gierth
b11b0e541e Add test for Bytes() 2017-10-22 17:18:59 +01:00
Steven Allen
a8637d432a Change QUIC multicodec to a unique number
It conflicted with CBOR.

part of multiformats/multicodec#55
2017-07-30 19:50:20 -07:00
Marten Seemann
22c78388e2
add QUIC 2017-03-17 13:26:26 +07:00
jbenet
bdf3e3a444 added unix path protocol 2016-09-19 11:06:27 +08:00
Ian Preston
e32e9cd0f0 Implemented byte decoder for onion addresses. Corrected onion bit size. 2016-08-09 19:21:28 +01:00
Jeromy
5734f44c3d go vet 2016-05-04 14:03:16 -07:00
Jeromy
ad12fa30fe respond to CR feedback 2016-05-04 13:26:50 -07:00
Jeromy
9c4a0baf6d cleanup panics and make NewFromBytes faster 2016-04-29 14:16:41 -07:00
Jeromy
ae64eb994b rewrite value for protocols and add more tests 2016-01-18 00:35:47 -08:00
Jeromy
a581da3f8f add method to lookup values in a multiaddr 2016-01-17 05:14:38 -08:00
David Stainton
24ecf94c70 Add more multiaddr tests for onions 2015-09-26 01:40:26 +02:00
David Stainton
0e7ae0d2ee Renamed tor to onion and added embedded port field 2015-08-31 03:19:47 +02:00
David Stainton
ed310561bd Add Tor .onion address support and unit test cases 2015-08-29 19:48:07 +02:00
Juan Batiz-Benet
f529ec7884 added http, https, and ipfs protocols 2015-01-17 21:12:54 -08:00
Juan Batiz-Benet
32d9d68b64 ProtocolsWithString 2015-01-09 05:51:16 -08:00
Juan Batiz-Benet
17f4666d01 Protocols now value 2015-01-09 05:37:39 -08:00
Juan Batiz-Benet
ed277d56f8 better errs, and test parsing 2015-01-09 05:30:33 -08:00
Juan Batiz-Benet
59f6cfc921 implement varints + add utp, udt 2014-11-19 13:02:06 -08:00
Juan Batiz-Benet
9d04132166 Split + Join 2014-11-05 02:20:27 -08:00
Juan Batiz-Benet
4a5dcd3a4d Split: added split method 2014-11-04 23:20:17 -08:00
Juan Batiz-Benet
2a572df05c ignore trailing slashes 2014-10-10 20:40:51 -07:00
Juan Batiz-Benet
c90ef4472f New Multiaddr interface
This commit changes the struct to a new Multiaddr interface:

```Go
type Multiaddr interface {
  Equal(Multiaddr) bool
  Bytes() []byte
  String() string
  Protocols() []*Protocol
  Encapsulate(Multiaddr) Multiaddr
  Decapsulate(Multiaddr) Multiaddr
}
```

This means a few things have changed:

- use Multiaddr interface, struct not exported
- Bytes returns a copy of the internal bytes
- Some methods no longer return errors (catch errors in NewMultiaddr)
  - String (panics if malformed)
  - Protocols (panics if malformed)
  - Decapsulate (no-op if not prefix)
- Moved net-specific functions to package
  - Multiaddr.DialArgs() -> DialArgs(Multiaddr)
  - Multiaddr.IsThinWaist() -> IsThinWaist(Multiaddr)

cc @whyrusleeping @perfmode
2014-10-06 03:27:29 -07:00
Juan Batiz-Benet
bd30912d08 Multiaddr.String no error
The error in String should not actually ocurr, as the multiaddr
should have been valid to be constructed successfully, and thus
should be encoded back to its string rep correctly.

This will be bolstered by creating an interface (to prevent messing
with the internal bytes)
2014-10-06 02:39:00 -07:00