Versions in this module Expand all Collapse all v1 v1.6.7 Feb 27, 2018 Changes in this version + var TypeClient = 1 + var TypeServer = 0 + func NewRPCClient(app module.App, serverId string) (mqrpc.RPCClient, error) + func NewRPCServer(app module.App, module module.Module) (mqrpc.RPCServer, error) + type AMQPClient struct + func NewAMQPClient(info *conf.Rabbitmq) (client *AMQPClient, err error) + func (c *AMQPClient) Call(callInfo mqrpc.CallInfo, callback chan rpcpb.ResultInfo) error + func (c *AMQPClient) CallNR(callInfo mqrpc.CallInfo) error + func (c *AMQPClient) Done() (err error) + func (c *AMQPClient) Marshal(rpcInfo *rpcpb.RPCInfo) ([]byte, error) + func (c *AMQPClient) Unmarshal(data []byte) (*rpcpb.RPCInfo, error) + func (c *AMQPClient) UnmarshalResult(data []byte) (*rpcpb.ResultInfo, error) + type AMQPServer struct + func NewAMQPServer(info *conf.Rabbitmq, call_chan chan mqrpc.CallInfo) (*AMQPServer, error) + func (s *AMQPServer) Callback(callinfo mqrpc.CallInfo) error + func (s *AMQPServer) MarshalResult(resultInfo rpcpb.ResultInfo) ([]byte, error) + func (s *AMQPServer) Shutdown() error + func (s *AMQPServer) StopConsume() error + func (s *AMQPServer) Unmarshal(data []byte) (*rpcpb.RPCInfo, error) + type ClinetCallInfo struct + type Consumer struct + func NewConsumer(info *conf.Rabbitmq, amqpURI, exchange, exchangeType, ctag string) (*Consumer, error) + func (c *Consumer) Cancel() error + func (c *Consumer) Shutdown() error + type LocalClient struct + func NewLocalClient(server mqrpc.LocalServer) (*LocalClient, error) + func (c *LocalClient) Call(callInfo mqrpc.CallInfo, callback chan rpcpb.ResultInfo) (err error) + func (c *LocalClient) CallNR(callInfo mqrpc.CallInfo) (err error) + func (c *LocalClient) Done() error + type LocalServer struct + func NewLocalServer(call_chan chan mqrpc.CallInfo) (*LocalServer, error) + func (s *LocalServer) Callback(callinfo mqrpc.CallInfo) error + func (s *LocalServer) IsClose() bool + func (s *LocalServer) SafeCallback(local_chan chan rpcpb.ResultInfo, callInfo rpcpb.ResultInfo) (closed bool) + func (s *LocalServer) SafeSend(local_chan chan mqrpc.CallInfo, callInfo mqrpc.CallInfo) (closed bool) + func (s *LocalServer) Shutdown() (err error) + func (s *LocalServer) StopConsume() error + func (s *LocalServer) Write(callInfo mqrpc.CallInfo) error + type RPCClient struct + func (c *RPCClient) Call(_func string, params ...interface{}) (interface{}, string) + func (c *RPCClient) CallArgs(_func string, ArgsType []string, args [][]byte) (interface{}, 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) + func (c *RPCClient) NewLocalClient(server mqrpc.RPCServer) (err error) + func (c *RPCClient) NewRabbitmqClient(info *conf.Rabbitmq) (err error) + func (c *RPCClient) NewRedisClient(info *conf.Redis) (err error) + type RPCServer struct + func (s *RPCServer) Done() (err error) + func (s *RPCServer) GetExecuting() int64 + func (s *RPCServer) GetLocalServer() mqrpc.LocalServer + func (s *RPCServer) NewRabbitmqRPCServer(info *conf.Rabbitmq) (err error) + func (s *RPCServer) NewRedisRPCServer(info *conf.Redis) (err error) + 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) + func (this *RPCServer) Finish() + func (this *RPCServer) Wait() error + type RabbitAgent struct + func NewRabbitAgent(info *conf.Rabbitmq, serverType int) (*RabbitAgent, error) + func (this *RabbitAgent) CallbackQueue() (string, error) + func (this *RabbitAgent) ClientPublish(body []byte) error + func (this *RabbitAgent) Closed() bool + func (this *RabbitAgent) ExchangeDeclare() error + func (this *RabbitAgent) Queue() error + func (this *RabbitAgent) RChannel() (*amqp.Channel, error) + func (this *RabbitAgent) RConnect() error + func (this *RabbitAgent) ReadMsg() chan amqp.Delivery + func (this *RabbitAgent) ServerPublish(queueName string, body []byte) error + func (this *RabbitAgent) Shutdown() error + func (this *RabbitAgent) WChannel() (*amqp.Channel, error) + func (this *RabbitAgent) WConnect() error + type RabbitMQInfo struct + type RedisClient struct + func NewRedisClient(info *conf.Redis) (client *RedisClient, err error) + func (c *RedisClient) Call(callInfo mqrpc.CallInfo, callback chan rpcpb.ResultInfo) error + func (c *RedisClient) CallNR(callInfo mqrpc.CallInfo) error + func (c *RedisClient) Done() (err error) + func (c *RedisClient) Marshal(rpcInfo *rpcpb.RPCInfo) ([]byte, error) + func (c *RedisClient) Unmarshal(data []byte) (*rpcpb.RPCInfo, error) + func (c *RedisClient) UnmarshalResult(data []byte) (*rpcpb.ResultInfo, error) + func (this *RedisClient) Finish() + func (this *RedisClient) Wait() error + type RedisServer struct + func NewRedisServer(info *conf.Redis, call_chan chan mqrpc.CallInfo) (*RedisServer, error) + func (s *RedisServer) Callback(callinfo mqrpc.CallInfo) error + func (s *RedisServer) MarshalResult(resultInfo rpcpb.ResultInfo) ([]byte, error) + func (s *RedisServer) Shutdown() error + func (s *RedisServer) StopConsume() error + func (s *RedisServer) Unmarshal(data []byte) (*rpcpb.RPCInfo, error)