Documentation ¶
Overview ¶
Package rpcpb is a generated protocol buffer package.
It is generated from these files:
rpc/rpc.proto
It has these top-level messages:
RPCInfo ResultInfo
Index ¶
- func CId(v string) cOption
- func CLog(v bool) cOption
- func CNats(v *nats.Conn) cOption
- func CRpcExpired(v int) cOption
- func CrpcId(v string) cOption
- func SId(v string) sOption
- func SLog(v bool) sOption
- func SMaxCoroutine(v int) sOption
- func SNats(v *nats.Conn) sOption
- type CallInfo
- type ClinetCallInfo
- type FunctionInfo
- type IRpcMsgClient
- type IRpcMsgServer
- type MQServer
- type NatsClient
- func (this *NatsClient) Call(callInfo CallInfo, callback chan ResultInfo) error
- func (this *NatsClient) CallNR(callInfo CallInfo) error
- func (c *NatsClient) Delete(key string) (err error)
- func (c *NatsClient) Done() (err error)
- func (this *NatsClient) Marshal(rpcInfo *RPCInfo) ([]byte, error)
- func (this *NatsClient) Unmarshal(data []byte) (*RPCInfo, error)
- func (this *NatsClient) UnmarshalResult(data []byte) (*ResultInfo, error)
- type NatsServer
- type RPCInfo
- func (*RPCInfo) Descriptor() ([]byte, []int)
- func (m *RPCInfo) GetArgs() [][]byte
- func (m *RPCInfo) GetArgsType() []string
- func (m *RPCInfo) GetCid() string
- func (m *RPCInfo) GetExpired() int64
- func (m *RPCInfo) GetFn() string
- func (m *RPCInfo) GetReply() bool
- func (m *RPCInfo) GetReplyTo() string
- func (m *RPCInfo) GetTrack() string
- func (*RPCInfo) ProtoMessage()
- func (m *RPCInfo) Reset()
- func (m *RPCInfo) String() string
- type RPCListener
- type ResultInfo
- func (*ResultInfo) Descriptor() ([]byte, []int)
- func (m *ResultInfo) GetCid() string
- func (m *ResultInfo) GetError() string
- func (m *ResultInfo) GetResult() []byte
- func (m *ResultInfo) GetResultType() string
- func (*ResultInfo) ProtoMessage()
- func (m *ResultInfo) Reset()
- func (m *ResultInfo) String() string
- type RpcClient
- func (this *RpcClient) Call(_func string, params ...interface{}) (interface{}, error)
- func (this *RpcClient) CallArgs(_func string, ArgsType []string, args [][]byte) (interface{}, string)
- func (this *RpcClient) CallNR(_func string, params ...interface{}) (err error)
- func (this *RpcClient) CallNRArgs(_func string, ArgsType []string, args [][]byte) (err error)
- func (this *RpcClient) Done() (err error)
- type RpcServer
- func (this *RpcServer) Call(callInfo CallInfo) error
- func (this *RpcServer) Done() (err error)
- func (this *RpcServer) Finish()
- func (this *RpcServer) Register(id string, f interface{})
- func (this *RpcServer) RegisterGO(id string, f interface{})
- func (this *RpcServer) RpcId() string
- func (this *RpcServer) UnRegister(id string, f interface{})
- func (this *RpcServer) Wait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRpcExpired ¶
func CRpcExpired(v int) cOption
func SMaxCoroutine ¶
func SMaxCoroutine(v int) sOption
Types ¶
type CallInfo ¶
type CallInfo struct { RpcInfo RPCInfo Result ResultInfo Props map[string]interface{} Agent MQServer //代理者 AMQPServer / LocalServer 都继承 Callback(callinfo CallInfo)(error) 方法 }
type ClinetCallInfo ¶
type ClinetCallInfo struct {
// contains filtered or unexported fields
}
type FunctionInfo ¶
type IRpcMsgClient ¶
type IRpcMsgServer ¶
type NatsClient ¶
type NatsClient struct {
// contains filtered or unexported fields
}
func NewNatsClient ¶
func NewNatsClient(rId string, nts *nats.Conn) (natsClient *NatsClient, err error)
func (*NatsClient) Call ¶
func (this *NatsClient) Call(callInfo CallInfo, callback chan ResultInfo) error
* 消息请求
func (*NatsClient) Delete ¶
func (c *NatsClient) Delete(key string) (err error)
func (*NatsClient) Done ¶
func (c *NatsClient) Done() (err error)
func (*NatsClient) UnmarshalResult ¶
func (this *NatsClient) UnmarshalResult(data []byte) (*ResultInfo, error)
type NatsServer ¶
type NatsServer struct {
// contains filtered or unexported fields
}
func NewNatsServer ¶
func NewNatsServer(server *RpcServer) (natsServer *NatsServer, err error)
func (*NatsServer) Callback ¶
func (this *NatsServer) Callback(callinfo CallInfo) error
func (*NatsServer) MarshalResult ¶
func (s *NatsServer) MarshalResult(resultInfo ResultInfo) ([]byte, error)
goroutine safe
func (*NatsServer) RpcId ¶
func (this *NatsServer) RpcId() string
type RPCInfo ¶
type RPCInfo struct { Cid string `protobuf:"bytes,1,opt,name=Cid" json:"Cid,omitempty"` Fn string `protobuf:"bytes,2,opt,name=Fn" json:"Fn,omitempty"` ReplyTo string `protobuf:"bytes,3,opt,name=ReplyTo" json:"ReplyTo,omitempty"` Track string `protobuf:"bytes,4,opt,name=track" json:"track,omitempty"` Expired int64 `protobuf:"varint,5,opt,name=Expired" json:"Expired,omitempty"` Reply bool `protobuf:"varint,6,opt,name=Reply" json:"Reply,omitempty"` ArgsType []string `protobuf:"bytes,7,rep,name=ArgsType" json:"ArgsType,omitempty"` Args [][]byte `protobuf:"bytes,8,rep,name=Args,proto3" json:"Args,omitempty"` }
func (*RPCInfo) Descriptor ¶
func (*RPCInfo) GetArgsType ¶
func (*RPCInfo) GetExpired ¶
func (*RPCInfo) GetReplyTo ¶
func (*RPCInfo) ProtoMessage ¶
func (*RPCInfo) ProtoMessage()
type RPCListener ¶
type ResultInfo ¶
type ResultInfo struct { Cid string `protobuf:"bytes,1,opt,name=Cid" json:"Cid,omitempty"` Error string `protobuf:"bytes,2,opt,name=CodeError" json:"CodeError,omitempty"` ResultType string `protobuf:"bytes,4,opt,name=ResultType" json:"ResultType,omitempty"` Result []byte `protobuf:"bytes,5,opt,name=Result,proto3" json:"Result,omitempty"` }
func NewResultInfo ¶
func NewResultInfo(Cid string, Error string, ArgsType string, result []byte) *ResultInfo
func (*ResultInfo) Descriptor ¶
func (*ResultInfo) Descriptor() ([]byte, []int)
func (*ResultInfo) GetCid ¶
func (m *ResultInfo) GetCid() string
func (*ResultInfo) GetError ¶
func (m *ResultInfo) GetError() string
func (*ResultInfo) GetResult ¶
func (m *ResultInfo) GetResult() []byte
func (*ResultInfo) GetResultType ¶
func (m *ResultInfo) GetResultType() string
func (*ResultInfo) ProtoMessage ¶
func (*ResultInfo) ProtoMessage()
func (*ResultInfo) Reset ¶
func (m *ResultInfo) Reset()
func (*ResultInfo) String ¶
func (m *ResultInfo) String() string
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func NewRpcClient ¶
func (*RpcClient) CallNRArgs ¶
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func NewRpcServer ¶
func (*RpcServer) RegisterGO ¶
func (*RpcServer) UnRegister ¶
Click to show internal directories.
Click to hide internal directories.