util

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package util provides utility functions for the webmesh libp2p integrations.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSecureTransport = fmt.Errorf("transport must be used with a webmesh keypair and security transport")

ErrInvalidSecureTransport is returned when the transport is not used with a webmesh keypair and security transport.

View Source
var ErrNotStarted = fmt.Errorf("transport is not started")

ErrNotStarted is returned when the transport is not started.

Functions

func ExtractWebmeshPublicKey

func ExtractWebmeshPublicKey(ctx context.Context, p peer.ID) (wmcrypto.PublicKey, error)

ExtractWebmeshPublicKey extracts the webmesh public key from a peer ID.

func GetTransport

func GetTransport(c net.Conn) (proto string)

GetTransport returns the transport type of a connection.

func ToWebmeshPrivateKey

func ToWebmeshPrivateKey(in crypto.PrivKey) (wmcrypto.PrivateKey, error)

ToWebmeshPrivateKey converts a libp2p private key to a webmesh private key.

func ToWebmeshPublicKey

func ToWebmeshPublicKey(in crypto.PubKey) (wmcrypto.PublicKey, error)

ToWebmeshPublicKey converts a libp2p public key to a webmesh public key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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