global

package
v0.0.0-...-3aaa451 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AreaInfo

type AreaInfo struct {
	AreaName string //域名称
	TcpAddr  string //TCP地址
	TcpPort  uint32 //TCP端口
}

type Global

type Global struct {
	StartEngine bool // 是否启动过engine

	Area map[string]*AreaInfo // 保存所有区域key:string=;value:*Area=;

	Addr string // 监听IP地址
	Port uint16 // 监听端口
	// contains filtered or unexported fields
}

func NewGlobal

func NewGlobal(key keystore.KeystoreInterface, pwd string) *Global

* NewGlobal 创建域名管理器 * * @param key keystore keystore * @param pwd string 密码 * @return global *Global 域名管理器

func (*Global) CheckOrAddAreaInfo

func (this *Global) CheckOrAddAreaInfo(areaName string) bool

* CheckOrAddAreaInfo 检查地址信息是否存在,不存在则添加相关记录 * * @param areaName string 域名名称 * @param ipAddr string ip地址 * @param port string 监听端口 * @return success bool 是否添加成功

func (*Global) GetEngine

func (this *Global) GetEngine() *engine.Engine

* 获取消息引擎

func (*Global) GetLevelDB

func (this *Global) GetLevelDB() *utilsleveldb.LevelDB

* 获取leveldb信息 * * @return levelDB leveldb指针

func (*Global) GetTcpHost

func (this *Global) GetTcpHost() (string, uint16)

* 获取监听的地址和端口

func (*Global) RemoveAreaInfo

func (this *Global) RemoveAreaInfo(areaName []byte)

* RemoveAreaInfo 移除域名对应的记录信息 * * @param areaName string 要移除的域名

func (*Global) SetLevelDB

func (this *Global) SetLevelDB(levelDB *utilsleveldb.LevelDB)

* 设置leveldb信息 * * @param levelDB leveldb指针

Jump to

Keyboard shortcuts

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