Documentation ¶
Index ¶
- Variables
- func SendDataToPeer(p2p *dep2p.DeP2P, pubsub *pubsub.DeP2PPubSub, protocol, topic, genre string, ...) error
- func SendPubSub(p2p *dep2p.DeP2P, pubsub *pubsub.DeP2PPubSub, topic, genre string, ...) error
- func SendStream(p2p *dep2p.DeP2P, protocol, genre string, receiver peer.ID, data interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var StreamMutex sync.Mutex
流互斥锁
Functions ¶
func SendDataToPeer ¶
func SendDataToPeer(p2p *dep2p.DeP2P, pubsub *pubsub.DeP2PPubSub, protocol, topic, genre string, receiver peer.ID, data interface{}) error
SendDataToPeer 尝试先通过流发送数据,失败后通过订阅发送 protocol 协议 topic 主题 genre 类型 receiver 接收方ID data 内容
func SendPubSub ¶
func SendPubSub(p2p *dep2p.DeP2P, pubsub *pubsub.DeP2PPubSub, topic, genre string, receiver peer.ID, data interface{}) error
SendPubSub 向指定的节点发送订阅消息 topic 主题 genre 类型 receiver 接收方ID data 内容
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.