discover

package
v0.0.0-...-eeae653 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxPingPong int = 1024

MaxPingPong 缓存最大值

Functions

func Build

func Build() *error.Error

Build 节点发现服务的构建入口, 主要初始化配置项

func ParsePackage

func ParsePackage(udpData map[string]interface{}) (interface{}, *error.Error)

ParsePackage 负责解析接收到的UDP数据包 @param data 从socket缓冲区中读取到的udp数据包 TODO 检查networkid、字段合法性、签名合法性问题

func ReceiveMsg

func ReceiveMsg(data interface{}) (interface{}, *error.Error)

ReceiveMsg 作为发现服务消息接收的入口

func ReceivePing

func ReceivePing(data interface{}) *error.Error

ReceivePing 接收Ping包的处理逻辑

func ReceivePong

func ReceivePong(data interface{}) *error.Error

ReceivePong 接收Pong包的所有处理逻辑

func RunDiscover

func RunDiscover(chanels map[string]chan map[string]interface{})

RunDiscover 主动寻找种子节点或邻居节点,进行连接

func RunService

func RunService(chanels map[string]chan map[string]interface{}, signal chan bool) *error.Error

RunService 启动UDP服务器,并持续监听状态。 @param chanel 与消息队列通信的发现服务专用管道 @param signal 用于通知上级服务udp服务已就绪

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL