mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2024-12-27 23:40:11 +08:00
check if peer supports a protocol without allocation
This commit is contained in:
parent
a4b837bc12
commit
43dfa5faf4
@ -233,5 +233,12 @@ type ProtoBook interface {
|
||||
AddProtocols(peer.ID, ...string) error
|
||||
SetProtocols(peer.ID, ...string) error
|
||||
RemoveProtocols(peer.ID, ...string) error
|
||||
|
||||
// SupportsProtocols returns the set of protocols the peer supports from among the given protocols.
|
||||
// If the returned error is not nil, the result is indeterminate.
|
||||
SupportsProtocols(peer.ID, ...string) ([]string, error)
|
||||
|
||||
// IsProtocolSupported returns true if the peer supports the given protocol and false otherwise.
|
||||
// If the returned error is not nil, the result is indeterminate.
|
||||
IsProtocolSupported(peer.ID, string) (bool, error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user