core/protocol/protocol library

Package protocol provides core interfaces for protocol routing and negotiation in libp2p.

This file contains the protocol ID type and interfaces for protocol routing and negotiation.

Classes

Negotiator
Negotiator is a component capable of reaching agreement over what protocols to use for inbound streams of communication.
ProtocolIDUtil
Utility functions for protocol IDs
ReservedProtocolIDs
These are reserved protocol IDs.
Router
Router is an interface that allows users to add and remove protocol handlers, which will be invoked when incoming stream requests for registered protocols are accepted.

Typedefs

HandlerFunc = void Function(ProtocolID protocol, P2PStream stream)
HandlerFunc is a user-provided function used by the Router to handle a protocol/stream.
ProtocolID = String
ProtocolID is a string identifier for a protocol.