mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 21:03:07 +00:00
Add docstring for WithAppSpecificRPCInspector (#510)
This commit is contained in:
parent
d3f151c224
commit
3d2eab3572
@ -533,6 +533,10 @@ func WithSeenMessagesTTL(ttl time.Duration) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAppSpecificRpcInspector sets a hook that inspect incomings RPCs prior to
|
||||
// processing them. The inspector is invoked on an accepted RPC just before it
|
||||
// is handled. If inspector's error is nil, the RPC is handled. Otherwise, it
|
||||
// is dropped.
|
||||
func WithAppSpecificRpcInspector(inspector func(peer.ID, *RPC) error) Option {
|
||||
return func(ps *PubSub) error {
|
||||
ps.appSpecificRpcInspector = inspector
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user