core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int32 //错误码

type Event_Key

type Event_Key string //事件Key
const (
	Event_ServiceStartEnd  Event_Key = "ServiceStartEnd"  //服务完全启动完毕
	Event_FindNewService   Event_Key = "FindNewService"   //发现新的服务
	Event_UpDataOldService Event_Key = "UpDataOldService" //发现新的服务
	Event_LoseService      Event_Key = "LoseService"      //丢失服务
)

type IModule

type IModule interface {
	GetType() M_Modules
	Init(service IService, module IModule, setting map[string]interface{}) (err error)
	OnInstallComp()
	Start() (err error)
	Run(closeSig chan bool) (err error)
	Destroy() (err error)
}

type IModuleComp

type IModuleComp interface {
	Init(service IService, module IModule, comp IModuleComp, setting map[string]interface{}) (err error)
	Start() (err error)
	Destroy() (err error)
}

type IService

type IService interface {
	GetId() string                                              //获取服务id
	GetType() string                                            //获取服务类型
	GetVersion() int32                                          //获取服务版本
	GetWorkPath() string                                        //获取服务工作目录
	GetSettings() ServiceSttings                                //获取服务配置表信息
	Init(service IService) (err error)                          //初始化接口
	InitSys()                                                   //初始化系统
	OnInstallComp(cops ...IServiceComp)                         //组装服务组件
	Start() (err error)                                         //启动服务
	Run(mods ...IModule)                                        //运行服务
	Close(closemsg string)                                      //关闭服务
	Destroy() (err error)                                       //销毁服务
	GetComp(CompName S_Comps) (comp IServiceComp, err error)    //获取组件
	GetModule(ModuleName M_Modules) (module IModule, err error) //获取模块
}

type IServiceComp

type IServiceComp interface {
	GetName() S_Comps
	Init(service IService, comp IServiceComp) (err error)
	Start() (err error)
	Destroy() (err error)
}

type IServiceSession

type IServiceSession interface {
	GetId() string
	GetRpcId() string
	GetType() string
	GetVersion() int32
	SetVersion(v int32)
	GetPreWeight() int32
	SetPreWeight(p int32)
	Done()
	CallNR(_func Rpc_Key, params ...interface{}) (err error)
	Call(_func Rpc_Key, params ...interface{}) (interface{}, error)
}

type IUserSession

type IUserSession interface {
	GetSessionId() string
	GetIP() string
	GetGateId() string
	SendMsg(comdId uint16, msgId uint16, msg interface{}) (err error)
	Close() (err error)
}

type M_Modules

type M_Modules string //模块类型

type Redis_Key

type Redis_Key string //Redis缓存

type Rpc_Key

type Rpc_Key string //RPC

type S_Category

type S_Category string //服务类别 例如 网关服务 游戏服务 业务服务   主要用于服务功能分类

type S_Comps

type S_Comps string //服务器组件类型

type ServiceSttings

type ServiceSttings struct {
	Settings map[string]interface{}
	Modules  map[string]map[string]interface{}
}

type SqlTable

type SqlTable string //数据库表定义

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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