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(app module.App, name string, node *registry.Node) (module.ServerSession, error)
- type BaseModule
- func (m *BaseModule) BeforeHandle(fn 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) GetRouteServer(moduleType string, opts ...selector.SelectOption) (s module.ServerSession, err error)
- func (m *BaseModule) GetServer() server.Server
- func (m *BaseModule) GetServerId() string
- func (m *BaseModule) GetStatistical() (statistical string, err error)
- func (m *BaseModule) GetSubclass() module.RPCModule
- func (m *BaseModule) NoFoundFunction(fn string) (*mqrpc.FunctionInfo, error)
- 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) RpcCall(ctx context.Context, moduleType, _func string, param mqrpc.ParamOption, ...) (interface{}, string)
- 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
- type StatisticalMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadStatisticalMethod ¶
func LoadStatisticalMethod(j string) map[string]*StatisticalMethod
func NewServerSession ¶
Types ¶
type BaseModule ¶
func (*BaseModule) BeforeHandle ¶
func (m *BaseModule) BeforeHandle(fn 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) GetRouteServer ¶
func (m *BaseModule) GetRouteServer(moduleType string, opts ...selector.SelectOption) (s module.ServerSession, err error)
func (*BaseModule) GetServer ¶
func (m *BaseModule) GetServer() server.Server
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) NoFoundFunction ¶
func (m *BaseModule) NoFoundFunction(fn string) (*mqrpc.FunctionInfo, error)
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, opt ...server.Option)
func (*BaseModule) OnTimeOut ¶
func (m *BaseModule) OnTimeOut(fn string, Expired int64)
func (*BaseModule) RpcCall ¶
func (m *BaseModule) RpcCall(ctx context.Context, moduleType, _func string, param mqrpc.ParamOption, opts ...selector.SelectOption) (interface{}, string)
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)