Documentation ¶
Overview ¶
Package util provides utility functions for the webmesh libp2p integrations.
Index ¶
- Variables
- func AddrToSignalMultiaddrs(addr netip.Addr) []ma.Multiaddr
- func ExtractWebmeshPublicKey(ctx context.Context, p peer.ID) (wmcrypto.PublicKey, error)
- func GetTransport(c net.Conn) (proto string)
- func ToWebmeshPrivateKey(in crypto.PrivKey) (wmcrypto.PrivateKey, error)
- func ToWebmeshPublicKey(in crypto.PubKey) (wmcrypto.PublicKey, error)
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 AddrToSignalMultiaddrs ¶
AddrToSignalMultiaddr converts a netip.Addr to a multiaddr intended for signaling.
func ExtractWebmeshPublicKey ¶
ExtractWebmeshPublicKey extracts the webmesh public key from a peer ID.
func GetTransport ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.