libp2putil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0, BSD-2-Clause Imports: 11 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 blocks.

func NewDelimitedReader

func NewDelimitedReader(r io.Reader) *UvarintReader

NewDelimitedReader returns a new UvarintReader.

func (*UvarintReader) ReadBlk

func (ur *UvarintReader) ReadBlk(blk proto.Message) error

ReadBlk read protobuf blocks.

type UvarintWriter

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

UvarintWriter writes protobuf blocks.

func NewDelimitedWriter

func NewDelimitedWriter(w io.Writer) *UvarintWriter

NewDelimitedWriter returns a new UvarintWriter.

func (*UvarintWriter) WriteBlk

func (uw *UvarintWriter) WriteBlk(blk proto.Message) (err error)

WriteBlk writes protobuf block.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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