Documentation ¶
Index ¶
- func DirectSend(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)
- func ForwardPeerClient(chainMessage *msg1.ChainMessage, peerClient *entity.PeerClient) (*msg1.ChainMessage, error)
- func ForwardPeerEndpoint(msg *msg1.ChainMessage, connectPeerId string) (*msg1.ChainMessage, error)
- func Lookup(targetPeerId string, targetClientId string) (*entity.PeerClient, string, error)
- func RelaySend(chainMessage *msg1.ChainMessage) (*msg1.ChainMessage, error)
- func Send(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectSend ¶
func DirectSend(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)
DirectSend 定位器之间直接发送方法
func ForwardPeerClient ¶ added in v0.1.24
func ForwardPeerClient(chainMessage *msg1.ChainMessage, peerClient *entity.PeerClient) (*msg1.ChainMessage, error)
func ForwardPeerEndpoint ¶ added in v0.1.24
func ForwardPeerEndpoint(msg *msg1.ChainMessage, connectPeerId string) (*msg1.ChainMessage, error)
func Lookup ¶ added in v0.1.24
* 本地和分布式查询PeerClient,如果找不到则查找PeerEndpoint 第一个参数返回找到的PeerClient,第二个参数返回找到的PeerEndpoint的peerId,即targetPeerId
func RelaySend ¶
func RelaySend(chainMessage *msg1.ChainMessage) (*msg1.ChainMessage, error)
RelaySend 转发chainmessage,根据TargetPeerId查询TargetConnectSessionId,找到如何到达目标
func Send ¶
func Send(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)
Send 发送ChainMessage消息的唯一方法 1.找出发送的目标地址和方式 2.根据情况处理校验,加密,压缩等 3.建立合适的通道并发送,比如libp2p的Pipe并Write消息流 4.等待即时的返回,校验,解密,解压缩等
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.