Documentation ¶
Index ¶
- Constants
- func Init(chanCloseSig chan bool)
- func Setup(s IService) bool
- func Start()
- func WaitStop()
- type IModule
- type IService
- type Module
- func (slf *Module) AddModule(module IModule) (int64, error)
- func (slf *Module) AfterFunc(d time.Duration, cb func()) *timer.Timer
- func (slf *Module) CronFunc(cronExpr *timer.CronExpr, cb func()) *timer.Cron
- func (slf *Module) GetAncestor() IModule
- func (slf *Module) GetEventHandler() event.IEventHandler
- func (slf *Module) GetEventProcessor() event.IEventProcessor
- func (slf *Module) GetModule(moduleId int64) IModule
- func (slf *Module) GetModuleId() int64
- func (slf *Module) GetModuleName() string
- func (slf *Module) GetParent() IModule
- func (slf *Module) GetService() IService
- func (slf *Module) NewModuleId() int64
- func (slf *Module) NotifyEvent(ev *event.Event)
- func (slf *Module) OnInit() error
- func (slf *Module) OnRelease()
- func (slf *Module) ReleaseModule(moduleId int64)
- func (slf *Module) SetModuleId(moduleId int64) bool
- type Service
- func (slf *Service) GetName() string
- func (slf *Service) GetProfiler() *profiler.Profiler
- func (slf *Service) GetServiceCfg() interface{}
- func (slf *Service) Init(iservice IService, getClientFun rpc.FuncRpcClient, ...)
- func (slf *Service) OnInit() error
- func (slf *Service) OnRelease()
- func (slf *Service) OnSetup(iservice IService)
- func (slf *Service) OpenProfiler()
- func (slf *Service) RegEventReciverFunc(eventType event.EventType, reciver event.IEventHandler, ...)
- func (slf *Service) Release()
- func (slf *Service) Run()
- func (slf *Service) SetGoRouterNum(gorouterNum int32) bool
- func (slf *Service) Start()
- func (slf *Service) UnRegEventReciverFun(eventType event.EventType, reciver event.IEventHandler)
- func (slf *Service) Wait()
Constants ¶
View Source
const InitModuleId = 1e17
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IModule ¶
type IModule interface { SetModuleId(moduleId int64) bool GetModuleId() int64 AddModule(module IModule) (int64, error) GetModule(moduleId int64) IModule GetAncestor() IModule ReleaseModule(moduleId int64) NewModuleId() int64 GetParent() IModule OnInit() error OnRelease() GetService() IService GetModuleName() string GetEventProcessor() event.IEventProcessor NotifyEvent(ev *event.Event) // contains filtered or unexported methods }
type IService ¶
type IService interface { Init(iservice IService, getClientFun rpc.FuncRpcClient, getServerFun rpc.FuncRpcServer, serviceCfg interface{}) GetName() string OnSetup(iservice IService) OnInit() error OnRelease() Wait() Start() GetRpcHandler() rpc.IRpcHandler GetServiceCfg() interface{} OpenProfiler() GetProfiler() *profiler.Profiler }
func GetService ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
1.管理各模块树层关系 2.提供定时器常用工具
func (*Module) GetAncestor ¶
func (*Module) GetEventHandler ¶
func (slf *Module) GetEventHandler() event.IEventHandler
func (*Module) GetEventProcessor ¶
func (slf *Module) GetEventProcessor() event.IEventProcessor
func (*Module) GetModuleId ¶
func (*Module) GetModuleName ¶
func (*Module) GetService ¶
func (*Module) NewModuleId ¶
func (*Module) NotifyEvent ¶
func (*Module) ReleaseModule ¶
func (*Module) SetModuleId ¶
type Service ¶
type Service struct { Module rpc.RpcHandler //rpc // contains filtered or unexported fields }
func (*Service) GetProfiler ¶
func (*Service) GetServiceCfg ¶
func (slf *Service) GetServiceCfg() interface{}
func (*Service) Init ¶
func (slf *Service) Init(iservice IService, getClientFun rpc.FuncRpcClient, getServerFun rpc.FuncRpcServer, serviceCfg interface{})
func (*Service) OpenProfiler ¶
func (slf *Service) OpenProfiler()
func (*Service) RegEventReciverFunc ¶
func (slf *Service) RegEventReciverFunc(eventType event.EventType, reciver event.IEventHandler, callback event.EventCallBack)
func (*Service) SetGoRouterNum ¶
func (*Service) UnRegEventReciverFun ¶
func (slf *Service) UnRegEventReciverFun(eventType event.EventType, reciver event.IEventHandler)
Click to show internal directories.
Click to hide internal directories.