Documentation ¶
Index ¶
- Constants
- Variables
- type AreaCountry
- func (ac *AreaCountry) GetAreaNodeIds(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) GetAreaNodeIdsRecv(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) GetAreaSaveNodeIds() ([]nodeStore.AddressNet, error)
- func (ac *AreaCountry) GetDefineData(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) GetDefineDataBack(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) GetNodeData() (string, error)
- func (ac *AreaCountry) Init()
- func (ac *AreaCountry) RegisteMSG()
- func (ac *AreaCountry) SaveData(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) SaveDataBack(c engine.Controller, msg engine.Packet, message *message_center.Message)
- func (ac *AreaCountry) Send() error
- func (ac *AreaCountry) SetData(str string) error
- func (ac *AreaCountry) Start()
- type AreaInfo
Constants ¶
View Source
const ( //---------------- 白名单设置列表 模块 -------------------------- MSGID_P2P_GET_DATA = 20001 //获取设置数据 MSGID_P2P_GET_DATA_BACK = 20002 //获取设置数据返回 MSGID_P2P_SEND_DATA = 20003 //同步数据到其它节点 MSGID_P2P_SEND_DATA_BACK = 20004 //同步数据到其它节点返回 MSGID_P2P_GET_NODE_IDS = 20005 //获取设置的大区信息 MSGID_P2P_GET_NODE_IDS_RECV = 20006 //获取设置的大区信息返回 )
View Source
const SendNodeAddr = "FNHWnFV8puymF1xFLMuPxPDgDxPk4rSBaSuJ7HYpjG8n"
这个地址是发送节点的地址(主节点地址),用于节点验证发送节点是否是指定的发送节点
Variables ¶
View Source
var CacheString string // 缓存信息
Functions ¶
This section is empty.
Types ¶
type AreaCountry ¶
type AreaCountry struct { Area *libp2parea.Area // 节点信息 IsInitNode bool // 是否是创世节点标识 // contains filtered or unexported fields }
大区信息
func NewAreaCountry ¶
func NewAreaCountry(area *libp2parea.Area, initNode bool) *AreaCountry
* 创建大区 * * @param area *Area 所属区域 * @param initNode bool 是不是创世节点标识 * @param masterNodeAddr string 主节点地址, 用于节点验证发送节点是否是指定的发送节点, 如果为空, 则默认地址为FNHWnFV8puymF1xFLMuPxPDgDxPk4rSBaSuJ7HYpjG8n * @return country *AreaCountry 大区信息
func (*AreaCountry) GetAreaNodeIds ¶
func (ac *AreaCountry) GetAreaNodeIds(c engine.Controller, msg engine.Packet, message *message_center.Message)
获取大区保存节点信息
func (*AreaCountry) GetAreaNodeIdsRecv ¶
func (ac *AreaCountry) GetAreaNodeIdsRecv(c engine.Controller, msg engine.Packet, message *message_center.Message)
获取大区保存节点信息返回
func (*AreaCountry) GetAreaSaveNodeIds ¶
func (ac *AreaCountry) GetAreaSaveNodeIds() ([]nodeStore.AddressNet, error)
* 获取节点地址列表 * * @return []nodeStore.Addresss
func (*AreaCountry) GetDefineData ¶
func (ac *AreaCountry) GetDefineData(c engine.Controller, msg engine.Packet, message *message_center.Message)
获取其他节点内存数据
func (*AreaCountry) GetDefineDataBack ¶
func (ac *AreaCountry) GetDefineDataBack(c engine.Controller, msg engine.Packet, message *message_center.Message)
func (*AreaCountry) GetNodeData ¶
func (ac *AreaCountry) GetNodeData() (string, error)
func (*AreaCountry) Init ¶
func (ac *AreaCountry) Init()
func (*AreaCountry) RegisteMSG ¶
func (ac *AreaCountry) RegisteMSG()
func (*AreaCountry) SaveData ¶
func (ac *AreaCountry) SaveData(c engine.Controller, msg engine.Packet, message *message_center.Message)
保存其它节点发来的数据
func (*AreaCountry) SaveDataBack ¶
func (ac *AreaCountry) SaveDataBack(c engine.Controller, msg engine.Packet, message *message_center.Message)
func (*AreaCountry) Send ¶
func (ac *AreaCountry) Send() error
func (*AreaCountry) Start ¶
func (ac *AreaCountry) Start()
Click to show internal directories.
Click to hide internal directories.