This repository has been archived by the owner on Dec 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate abstractions and core types into go-libp2p-core (#48)
- Loading branch information
Showing
11 changed files
with
134 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer instead. | ||
package peer | ||
|
||
import ( | ||
core "github.com/libp2p/go-libp2p-core/peer" | ||
ic "github.com/libp2p/go-libp2p-crypto" | ||
) | ||
|
||
var ( | ||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.ErrEmptyPeerID instead. | ||
ErrEmptyPeerID = core.ErrEmptyPeerID | ||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.ErrNoPublicKey instead. | ||
ErrNoPublicKey = core.ErrNoPublicKey | ||
) | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.AdvanceEnableInlining instead. | ||
// Warning: this variable's type makes it impossible to alias by reference. | ||
// Reads and writes from/to this variable may be inaccurate or not have the intended effect. | ||
var AdvancedEnableInlining = core.AdvancedEnableInlining | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.ID instead. | ||
type ID = core.ID | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDSlice instead. | ||
type IDSlice = core.IDSlice | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDFromString instead. | ||
func IDFromString(s string) (core.ID, error) { | ||
return core.IDFromString(s) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDFromBytes instead. | ||
func IDFromBytes(b []byte) (core.ID, error) { | ||
return core.IDFromBytes(b) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDB58Decode instead. | ||
func IDB58Decode(s string) (core.ID, error) { | ||
return core.IDB58Decode(s) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDB58Encode instead. | ||
func IDB58Encode(id ID) string { | ||
return core.IDB58Encode(id) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDHexDecode instead. | ||
func IDHexDecode(s string) (core.ID, error) { | ||
return core.IDHexDecode(s) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDHexEncode instead. | ||
func IDHexEncode(id ID) string { | ||
return core.IDHexEncode(id) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDFromPublicKey instead. | ||
func IDFromPublicKey(pk ic.PubKey) (core.ID, error) { | ||
return core.IDFromPublicKey(pk) | ||
} | ||
|
||
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.IDFromPrivateKey instead. | ||
func IDFromPrivateKey(sk ic.PrivKey) (core.ID, error) { | ||
return core.IDFromPrivateKey(sk) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module github.com/libp2p/go-libp2p-peer | ||
|
||
require ( | ||
github.com/libp2p/go-libp2p-crypto v0.0.2 | ||
github.com/mr-tron/base58 v1.1.2 | ||
github.com/multiformats/go-multihash v0.0.5 | ||
github.com/libp2p/go-libp2p-core v0.0.1 | ||
github.com/libp2p/go-libp2p-crypto v0.1.0 | ||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.