Commit Graph

39 Commits

Author SHA1 Message Date
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
Juan Batiz-Benet 74443fca31 Added Equal func 2014-09-16 06:08:48 -07:00
Juan Batiz-Benet b90678896b go lint + unexporting some funcs 2014-09-11 10:47:56 -07:00
Juan Batiz-Benet 99196c0d23 dialing + consts 2014-07-07 01:25:20 -07:00
Juan Batiz-Benet 9033141fca gofmt 2014-07-04 11:21:39 -07:00
Juan Batiz-Benet 3855a29d4e en/decapsulation 2014-07-04 00:48:33 -07:00
Juan Batiz-Benet e20c5b9d3b protocols 2014-07-04 00:12:33 -07:00
Juan Batiz-Benet c5510ff4b8 string <> []byte 2014-07-03 23:42:24 -07:00