Documentation ¶
Overview ¶
Deprecated: This package has moved into go-libp2p as a sub-package: github.com/libp2p/go-libp2p/core/protocol.
Package protocol provides core interfaces for protocol routing and negotiation in libp2p.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToStrings ¶
ConvertToStrings is a convenience function that takes a slice of protocol.ID and converts it to a slice of strings. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ConvertToStrings instead
Types ¶
type HandlerFunc ¶
type HandlerFunc = protocol.HandlerFunc
HandlerFunc is a user-provided function used by the Router to handle a protocol/stream.
Will be invoked with the protocol ID string as the first argument, which may differ from the ID used for registration if the handler was registered using a match function. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.HandlerFunc instead
type ID ¶
ID is an identifier used to write protocol headers in streams. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ID instead
const ( // Deprecated: use github.com/libp2p/go-libp2p/core/protocol.TestingID instead TestingID ID = protocol.TestingID )
These are reserved protocol.IDs.
func ConvertFromStrings ¶
ConvertFromStrings is a convenience function that takes a slice of strings and converts it to a slice of protocol.ID. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.ConvertFromStrings instead
type Negotiator ¶
type Negotiator = protocol.Negotiator
Negotiator is a component capable of reaching agreement over what protocols to use for inbound streams of communication. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.Negotiator instead
type 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.
Upon receiving an incoming stream request, the Router will check all registered protocol handlers to determine which (if any) is capable of handling the stream. The handlers are checked in order of registration; if multiple handlers are eligible, only the first to be registered will be invoked. Deprecated: use github.com/libp2p/go-libp2p/core/protocol.Router instead