Documentation ¶
Overview ¶
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqantserver Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqant Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func LoadStatisticalMethod(j string) map[string]*StatisticalMethod
- func NewServerSession(Id string, Stype string, Btype byte, Rpc mqrpc.RPCClient) module.ServerSession
- type BaseModule
- func (m *BaseModule) BeforeHandle(fn string, session string, callInfo *mqrpc.CallInfo) error
- func (m *BaseModule) GetApp() module.App
- func (m *BaseModule) GetExecuting() int64
- func (m *BaseModule) GetModuleSettings() *conf.ModuleSettings
- func (m *BaseModule) GetRouteServers(moduleType string, hash string) (s module.ServerSession, err error)
- func (m *BaseModule) GetServer() *rpcserver
- func (m *BaseModule) GetServerId() string
- func (m *BaseModule) GetStatistical() (statistical string, err error)
- func (m *BaseModule) OnComplete(fn string, callInfo *mqrpc.CallInfo, result *rpcpb.ResultInfo, exec_time int64)
- func (m *BaseModule) OnConfChanged(settings *conf.ModuleSettings)
- func (m *BaseModule) OnDestroy()
- func (m *BaseModule) OnError(fn string, callInfo *mqrpc.CallInfo, err error)
- func (m *BaseModule) OnInit(subclass module.RPCModule, app module.App, settings *conf.ModuleSettings)
- func (m *BaseModule) OnTimeOut(fn string, byteFn int32, Expired int64)
- func (m *BaseModule) RpcInvokeArgs(moduleType string, _func string, SessionID string, args []byte) (result interface{}, err *base.ErrorCode)
- func (m *BaseModule) RpcInvokeNRArgs(moduleType string, _func string, SessionId string, args []byte) (err error)
- func (m *BaseModule) SetListener(listener mqrpc.RPCListener)
- type DefaultModule
- type ModuleManager
- func (mer *ModuleManager) CheckModuleSettings()
- func (mer *ModuleManager) Destroy()
- func (mer *ModuleManager) GetModules() []*DefaultModule
- func (mer *ModuleManager) GetRunModules() []*DefaultModule
- func (mer *ModuleManager) Init(app module.App, ProcessID string)
- func (mer *ModuleManager) Register(mi module.Module)
- func (mer *ModuleManager) RegisterRunMod(mi module.Module)
- func (mer *ModuleManager) ReportStatistics(args interface{})
- type StatisticalMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadStatisticalMethod ¶
func LoadStatisticalMethod(j string) map[string]*StatisticalMethod
func NewServerSession ¶
func NewServerSession(Id string, Stype string, Btype byte, Rpc mqrpc.RPCClient) module.ServerSession
Types ¶
type BaseModule ¶
func (*BaseModule) BeforeHandle ¶
func (m *BaseModule) BeforeHandle(fn string, session string, callInfo *mqrpc.CallInfo) error
func (*BaseModule) GetApp ¶
func (m *BaseModule) GetApp() module.App
func (*BaseModule) GetExecuting ¶
func (m *BaseModule) GetExecuting() int64
func (*BaseModule) GetModuleSettings ¶
func (m *BaseModule) GetModuleSettings() *conf.ModuleSettings
func (*BaseModule) GetRouteServers ¶
func (m *BaseModule) GetRouteServers(moduleType string, hash string) (s module.ServerSession, err error)
func (*BaseModule) GetServer ¶
func (m *BaseModule) GetServer() *rpcserver
func (*BaseModule) GetServerId ¶
func (m *BaseModule) GetServerId() string
func (*BaseModule) GetStatistical ¶
func (m *BaseModule) GetStatistical() (statistical string, err error)
func (*BaseModule) OnComplete ¶
func (m *BaseModule) OnComplete(fn string, callInfo *mqrpc.CallInfo, result *rpcpb.ResultInfo, exec_time int64)
* fn 方法名 params 参数 result 执行结果 exec_time 方法执行时间 单位为 Nano 纳秒 1000000纳秒等于1毫秒
func (*BaseModule) OnConfChanged ¶
func (m *BaseModule) OnConfChanged(settings *conf.ModuleSettings)
func (*BaseModule) OnDestroy ¶
func (m *BaseModule) OnDestroy()
func (*BaseModule) OnError ¶
func (m *BaseModule) OnError(fn string, callInfo *mqrpc.CallInfo, err error)
func (*BaseModule) OnInit ¶
func (m *BaseModule) OnInit(subclass module.RPCModule, app module.App, settings *conf.ModuleSettings)
func (*BaseModule) OnTimeOut ¶
func (m *BaseModule) OnTimeOut(fn string, byteFn int32, Expired int64)
func (*BaseModule) RpcInvokeArgs ¶
func (*BaseModule) RpcInvokeNRArgs ¶
func (*BaseModule) SetListener ¶
func (m *BaseModule) SetListener(listener mqrpc.RPCListener)
type DefaultModule ¶
type DefaultModule struct { Mi module.Module Settings *conf.ModuleSettings // contains filtered or unexported fields }
type ModuleManager ¶
type ModuleManager struct {
// contains filtered or unexported fields
}
func NewModuleManager ¶
func NewModuleManager() (m *ModuleManager)
func (*ModuleManager) CheckModuleSettings ¶
func (mer *ModuleManager) CheckModuleSettings()
* module配置文件规则检查 1. ID全局必须唯一 2. 每一个类型的Module列表中ProcessID不能重复
func (*ModuleManager) Destroy ¶
func (mer *ModuleManager) Destroy()
func (*ModuleManager) GetModules ¶
func (mer *ModuleManager) GetModules() []*DefaultModule
func (*ModuleManager) GetRunModules ¶
func (mer *ModuleManager) GetRunModules() []*DefaultModule
func (*ModuleManager) Register ¶
func (mer *ModuleManager) Register(mi module.Module)
func (*ModuleManager) RegisterRunMod ¶
func (mer *ModuleManager) RegisterRunMod(mi module.Module)
func (*ModuleManager) ReportStatistics ¶
func (mer *ModuleManager) ReportStatistics(args interface{})