Commit Graph

9 Commits

Author SHA1 Message Date
Marten Seemann
6cef973b92
remove deprecated functions in the peer package (#205) 2021-07-22 12:17:36 -07:00
Steven Allen
8c04ed1323
feat: add helper functions for working with addr infos (#202)
Specifically, move them _here_ from the peerstore. That way
packages (like the DHT) that currently directly rely on the peerstore,
can just use go-libp2p-core.

Moved from f7f22569f7/peerstore.go (L79-L93)

With some small modifications.
2021-07-21 13:09:49 -07:00
Marten Seemann
ea8b36912f
fix staticcheck errors (#191)
* run go mod tidy

* omit receiver name if unused

* remove unused type testkey in tests

* fix duplicate import of go-multiaddr

* fix use of deprecated peer.IDB58{Encode,Decode}

* use bytes.Equal instead of bytes.Compare

* fix unnecessary assigments to blank identifier

* use time.Until instead of t.Sub(time.Now())

* fix use of deprecated go-multihash.ID

* add missing error check in envelope test

* fix error check in tests
2021-03-30 16:13:36 -07:00
Whyrusleeping
11f3c3ac0c
add a helper function to go directly from a string to an AddrInfo (#184)
* add a helper function to go directly from a string to an AddrInfo

* Update peer/addrinfo.go

Co-authored-by: Will <will.scott@protocol.ai>

Co-authored-by: Will <will.scott@protocol.ai>
2021-02-22 09:55:28 -08:00
Vasco Santos
43f10f2288 docs: uniform comment sentences 2020-03-03 18:16:38 +01:00
Steven Allen
c2a62a74af feat(peer): implement AddrInfosFromP2pAddrs and SplitAddr
* SplitAddr is a simpler way to split an address into a multiaddr and an ID.
* AddrInfosFromP2pAddrs converts a set of multiaddrs into a set of AddrInfos.
2019-05-31 12:25:57 -07:00
Steven Allen
ecce2522bf fix: handle empty addrs case 2019-05-30 22:25:37 -07:00
Steven Allen
5ea5a0797b chore: cleanup address parsing
* Use SplitLast to avoid allocating too much.
* Avoid converting to/from strings when working with multiaddrs.
2019-05-30 21:57:09 -07:00
Raúl Kripalani
6e566d10f4
Absorb go-libp2p abstractions and core types into this module (#1) 2019-05-22 18:31:11 +01:00