protocol

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package protocol defines the libp2p webmesh protocol.

Index

Constants

View Source
const Code = 613

Code is the code for the webmesh libp2p protocol.

View Source
const ID = "webmesh"

ID is the ID for the webmesh libp2p protocol.

View Source
const P_WEBMESH = Code

P_WEBMESH is the code for the webmesh libp2p protocol.

View Source
const SecurityID = "/webmesh/id/1.0.0"

SecurityID is the protocol ID of the security protocol.

Variables

View Source
var ErrNoPeerID = fmt.Errorf("no peer ID in webmesh multiaddr")

ErrNoPeerID is returned when a webmesh multiaddr does not contain a peer ID.

View Source
var ErrNoRedezvous = fmt.Errorf("no rendezvous in webmesh multiaddr")

ErrNoRedezvous is returned when a webmesh multiaddr does not contain a rendezvous.

View Source
var Protocol = multiaddr.Protocol{
	Name:       ID,
	Code:       Code,
	VCode:      multiaddr.CodeToVarint(Code),
	Size:       -1,
	Path:       true,
	Transcoder: multiaddr.NewTranscoderFromFunctions(protocolStrToBytes, protocolBytesToStr, validateBytes),
}

Protocol is the webmesh libp2p protocol.

Functions

func PeerIDFromWebmeshAddr

func PeerIDFromWebmeshAddr(addr multiaddr.Multiaddr) (peer.ID, error)

PeerIDFromWebmeshAddr returns the peer ID argument from a webmesh multiaddr.

func RendezvousFromWebmeshAddr

func RendezvousFromWebmeshAddr(addr multiaddr.Multiaddr) (string, error)

RendezvousFromWebmeshAddr returns the rendezvous argument from a webmesh multiaddr.

func WithPeerID

func WithPeerID(pid peer.ID) multiaddr.Multiaddr

WithPeerID returns a webmesh multiaddr with the given peer ID.

func WithPeerIDAndRendezvous

func WithPeerIDAndRendezvous(pid peer.ID, rendezvous string) multiaddr.Multiaddr

WithPeerIDAndRendezvous returns a webmesh multiaddr with the given peer ID and rendezvous.

Types

This section is empty.

Jump to

Keyboard shortcuts

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