libp2putil

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2022 License: Apache-2.0, BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLibp2pIdentity

func GetLibp2pIdentity(lPeer *peer.Local) (libp2p.Option, error)

GetLibp2pIdentity returns libp2p Host option for Identity from local peer object.

func ToLibp2pPeerID

func ToLibp2pPeerID(p *peer.Peer) (libp2ppeer.ID, error)

ToLibp2pPeerID computes libp2p peer ID from our peer object.

func ToLibp2pPrivateKey

func ToLibp2pPrivateKey(ourPrivateKey ed25519.PrivateKey) (libp2pcrypto.PrivKey, error)

ToLibp2pPrivateKey transforms private key in our type to libp2p type.

Types

type UvarintReader

type UvarintReader struct {
	// contains filtered or unexported fields
}

UvarintReader read protobuf messages.

func NewDelimitedReader

func NewDelimitedReader(r io.Reader) *UvarintReader

NewDelimitedReader returns a new UvarintReader.

func (*UvarintReader) ReadMsg

func (ur *UvarintReader) ReadMsg(msg proto.Message) error

ReadMsg read protobuf messages.

type UvarintWriter

type UvarintWriter struct {
	// contains filtered or unexported fields
}

UvarintWriter writes protobuf messages.

func NewDelimitedWriter

func NewDelimitedWriter(w io.Writer) *UvarintWriter

NewDelimitedWriter returns a new UvarintWriter.

func (*UvarintWriter) WriteMsg

func (uw *UvarintWriter) WriteMsg(msg proto.Message) (err error)

WriteMsg writes protobuf message.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL