Documentation
¶
Overview ¶
package peer implements an object used to represent peers in the ipfs network.
Index ¶
- Variables
- func IDB58Encode(id ID) string
- func IDHexEncode(id ID) string
- type ID
- func IDB58Decode(s string) (ID, error)
- func IDFromBytes(b []byte) (ID, error)
- func IDFromEd25519PublicKey(pk ic.PubKey) (ID, error)
- func IDFromPrivateKey(sk ic.PrivKey) (ID, error)
- func IDFromPublicKey(pk ic.PubKey) (ID, error)
- func IDFromString(s string) (ID, error)
- func IDHexDecode(s string) (ID, error)
- func (id ID) ExtractEd25519PublicKey() (ic.PubKey, error)
- func (id ID) ExtractPublicKey() ic.PubKey
- func (id ID) Loggable() map[string]interface{}
- func (id ID) MatchesPrivateKey(sk ic.PrivKey) bool
- func (id ID) MatchesPublicKey(pk ic.PubKey) bool
- func (id ID) Pretty() string
- func (id ID) String() string
- type IDSlice
Constants ¶
This section is empty.
Variables ¶
View Source
var CodePrefixErr = errors.New("unexpected code prefix")
View Source
var MultihashCodecErr = errors.New("unexpected multihash codec")
View Source
var MultihashDecodeErr = errors.New("unable to decode multihash")
View Source
var MultihashLengthErr = errors.New("unexpected multihash length")
Functions ¶
Types ¶
type ID ¶
type ID string
func IDFromBytes ¶
IDFromBytes cast a string to ID type, and validate the id to make sure it is a multihash.
func IDFromEd25519PublicKey ¶
IDFromEd25519PublicKey returns the Peer ID corresponding to Id25519 pk
func IDFromPrivateKey ¶
IDFromPrivateKey returns the Peer ID corresponding to sk
func IDFromPublicKey ¶
IDFromPublicKey returns the Peer ID corresponding to pk
func IDFromString ¶
IDFromString cast a string to ID type, and validate the id to make sure it is a multihash.
func (ID) ExtractPublicKey ¶
ExtractPublicKey attempts to extract the public key from an ID
func (ID) MatchesPrivateKey ¶
MatchesPrivateKey tests whether this ID was derived from sk
func (ID) MatchesPublicKey ¶
MatchesPublicKey tests whether this ID was derived from pk
Click to show internal directories.
Click to hide internal directories.