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, Rpc mqrpc.RPCClient) module.ServerSession
- type BaseModule
- func (m *BaseModule) BeforeHandle(fn string, session gate.Session, callInfo *mqrpc.CallInfo) error
- func (m *BaseModule) GetApp() module.App
- func (m *BaseModule) GetExecuting() int64
- func (m *BaseModule) GetModuleSettings() *conf.ModuleSettings
- func (m *BaseModule) GetRouteServer(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) GetSubclass() module.RPCModule
- func (m *BaseModule) OnAppConfigurationLoaded(app module.App)
- 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, Expired int64)
- func (m *BaseModule) RpcInvoke(moduleType string, _func string, params ...interface{}) (result interface{}, err string)
- func (m *BaseModule) RpcInvokeArgs(moduleType string, _func string, ArgsType []string, args [][]byte) (result interface{}, err string)
- func (m *BaseModule) RpcInvokeNR(moduleType string, _func string, params ...interface{}) (err error)
- func (m *BaseModule) RpcInvokeNRArgs(moduleType string, _func string, ArgsType []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) 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, Rpc mqrpc.RPCClient) module.ServerSession
Types ¶
type BaseModule ¶
func (*BaseModule) BeforeHandle ¶
func (m *BaseModule) BeforeHandle(fn string, session gate.Session, 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) GetRouteServer ¶
func (m *BaseModule) GetRouteServer(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) GetSubclass ¶
func (m *BaseModule) GetSubclass() module.RPCModule
func (*BaseModule) OnAppConfigurationLoaded ¶
func (m *BaseModule) OnAppConfigurationLoaded(app module.App)
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, Expired int64)
func (*BaseModule) RpcInvoke ¶
func (m *BaseModule) RpcInvoke(moduleType string, _func string, params ...interface{}) (result interface{}, err string)
func (*BaseModule) RpcInvokeArgs ¶
func (*BaseModule) RpcInvokeNR ¶
func (m *BaseModule) RpcInvokeNR(moduleType string, _func string, params ...interface{}) (err error)
func (*BaseModule) RpcInvokeNRArgs ¶
func (*BaseModule) SetListener ¶
func (m *BaseModule) SetListener(listener mqrpc.RPCListener)
type DefaultModule ¶
type DefaultModule struct {
// 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) 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{})