Documentation ¶
Index ¶
- Constants
- func Init(chanCloseSig chan bool)
- func Setup(s IService) bool
- func Start()
- func WaitStop()
- type IModule
- type IService
- type Module
- func (m *Module) AddModule(module IModule) (int64, error)
- func (m *Module) AfterFunc(d time.Duration, cb func()) *timer.Timer
- func (m *Module) CronFunc(cronExpr *timer.CronExpr, cb func()) *timer.Cron
- func (m *Module) GetAncestor() IModule
- func (m *Module) GetEventHandler() event.IEventHandler
- func (m *Module) GetEventProcessor() event.IEventProcessor
- func (m *Module) GetModule(moduleId int64) IModule
- func (m *Module) GetModuleId() int64
- func (m *Module) GetModuleName() string
- func (m *Module) GetParent() IModule
- func (m *Module) GetService() IService
- func (m *Module) NewModuleId() int64
- func (m *Module) NewTicker(d time.Duration, cb func()) *timer.Ticker
- func (m *Module) NotifyEvent(ev *event.Event)
- func (m *Module) OnAddTimer(t *timewheel.Timer)
- func (m *Module) OnCloseTimer(timer *timewheel.Timer)
- func (m *Module) OnInit() error
- func (m *Module) OnRelease()
- func (m *Module) ReleaseModule(moduleId int64)
- func (m *Module) SetModuleId(moduleId int64) bool
- type Service
- func (s *Service) GetName() string
- func (s *Service) GetProfiler() *profiler.Profiler
- func (s *Service) GetServiceCfg() interface{}
- func (s *Service) Init(iService IService, getClientFun rpc.FuncRpcClient, ...)
- func (s *Service) IsSingleCoroutine() bool
- func (s *Service) OnInit() error
- func (s *Service) OnRelease()
- func (s *Service) OnSetup(iService IService)
- func (s *Service) OpenProfiler()
- func (s *Service) RegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler, ...)
- func (s *Service) Release()
- func (s *Service) Run()
- func (s *Service) SetGoRouterNum(goroutineNum int32) bool
- func (s *Service) SetName(serviceName string)
- func (s *Service) Start()
- func (s *Service) UnRegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler)
- func (s *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{}) SetName(serviceName string) 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 (m *Module) GetEventHandler() event.IEventHandler
func (*Module) GetEventProcessor ¶
func (m *Module) GetEventProcessor() event.IEventProcessor
func (*Module) GetModuleId ¶
func (*Module) GetModuleName ¶
func (*Module) GetService ¶
func (*Module) NewModuleId ¶
func (*Module) NotifyEvent ¶
func (*Module) OnAddTimer ¶
func (*Module) OnCloseTimer ¶
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 (s *Service) GetServiceCfg() interface{}
func (*Service) Init ¶
func (s *Service) Init(iService IService, getClientFun rpc.FuncRpcClient, getServerFun rpc.FuncRpcServer, serviceCfg interface{})
func (*Service) IsSingleCoroutine ¶
func (*Service) OpenProfiler ¶
func (s *Service) OpenProfiler()
func (*Service) RegEventReceiverFunc ¶
func (s *Service) RegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler, callback event.EventCallBack)
func (*Service) SetGoRouterNum ¶
func (*Service) UnRegEventReceiverFunc ¶
func (s *Service) UnRegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler)
Click to show internal directories.
Click to hide internal directories.