Documentation ¶
Overview ¶
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.
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.
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.
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.
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 NewRPCClient(app module.App, session module.ServerSession) (mqrpc.RPCClient, error)
- func NewRPCServer(app module.App, module module.Module) (mqrpc.RPCServer, error)
- type ClinetCallInfo
- type NatsClient
- func (c *NatsClient) Call(callInfo mqrpc.CallInfo, callback chan rpcpb.ResultInfo) error
- func (c *NatsClient) CallNR(callInfo mqrpc.CallInfo) error
- func (c *NatsClient) CloseFch(fch chan rpcpb.ResultInfo)
- func (c *NatsClient) Delete(key string) (err error)
- func (c *NatsClient) Done() (err error)
- func (c *NatsClient) Marshal(rpcInfo *rpcpb.RPCInfo) ([]byte, error)
- func (c *NatsClient) Unmarshal(data []byte) (*rpcpb.RPCInfo, error)
- func (c *NatsClient) UnmarshalResult(data []byte) (*rpcpb.ResultInfo, error)
- type NatsServer
- type RPCClient
- func (c *RPCClient) Call(ctx context.Context, _func string, params ...interface{}) (interface{}, string)
- func (c *RPCClient) CallArgs(ctx context.Context, _func string, ArgsType []string, args [][]byte) (r interface{}, e string)
- func (c *RPCClient) CallNR(_func string, params ...interface{}) (err error)
- func (c *RPCClient) CallNRArgs(_func string, ArgsType []string, args [][]byte) (err error)
- func (c *RPCClient) Done() (err error)
- type RPCServer
- func (this *RPCServer) Addr() string
- func (s *RPCServer) Call(callInfo mqrpc.CallInfo) error
- func (s *RPCServer) Done() (err error)
- func (s *RPCServer) GetExecuting() int64
- func (s *RPCServer) Register(id string, f interface{})
- func (s *RPCServer) RegisterGO(id string, f interface{})
- func (s *RPCServer) SetGoroutineControl(control mqrpc.GoroutineControl)
- func (s *RPCServer) SetListener(listener mqrpc.RPCListener)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRPCClient ¶
func NewRPCClient(app module.App, session module.ServerSession) (mqrpc.RPCClient, error)
Types ¶
type ClinetCallInfo ¶
type ClinetCallInfo struct {
// contains filtered or unexported fields
}
type NatsClient ¶
type NatsClient struct {
// contains filtered or unexported fields
}
func NewNatsClient ¶
func NewNatsClient(app module.App, session module.ServerSession) (client *NatsClient, err error)
func (*NatsClient) Call ¶
func (c *NatsClient) Call(callInfo mqrpc.CallInfo, callback chan rpcpb.ResultInfo) error
* 消息请求
func (*NatsClient) CloseFch ¶
func (c *NatsClient) CloseFch(fch chan rpcpb.ResultInfo)
func (*NatsClient) Delete ¶
func (c *NatsClient) Delete(key string) (err error)
func (*NatsClient) Done ¶
func (c *NatsClient) Done() (err error)
func (*NatsClient) Marshal ¶
func (c *NatsClient) Marshal(rpcInfo *rpcpb.RPCInfo) ([]byte, error)
goroutine safe
func (*NatsClient) Unmarshal ¶
func (c *NatsClient) Unmarshal(data []byte) (*rpcpb.RPCInfo, error)
func (*NatsClient) UnmarshalResult ¶
func (c *NatsClient) UnmarshalResult(data []byte) (*rpcpb.ResultInfo, error)
type NatsServer ¶
type NatsServer struct {
// contains filtered or unexported fields
}
func NewNatsServer ¶
func NewNatsServer(app module.App, s *RPCServer) (*NatsServer, error)
func (*NatsServer) Addr ¶
func (s *NatsServer) Addr() string
func (*NatsServer) Callback ¶
func (s *NatsServer) Callback(callinfo mqrpc.CallInfo) error
func (*NatsServer) MarshalResult ¶
func (s *NatsServer) MarshalResult(resultInfo rpcpb.ResultInfo) ([]byte, error)
goroutine safe
func (*NatsServer) Unmarshal ¶
func (s *NatsServer) Unmarshal(data []byte) (*rpcpb.RPCInfo, error)
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
func (*RPCClient) Call ¶
func (c *RPCClient) Call(ctx context.Context, _func string, params ...interface{}) (interface{}, string)
* 消息请求 需要回复
func (*RPCClient) CallNRArgs ¶
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
func (*RPCServer) RegisterGO ¶
you must call the function before calling Open and Go
func (*RPCServer) SetGoroutineControl ¶
func (s *RPCServer) SetGoroutineControl(control mqrpc.GoroutineControl)
func (*RPCServer) SetListener ¶
func (s *RPCServer) SetListener(listener mqrpc.RPCListener)