Documentation ¶
Index ¶
- Constants
- func RegisterPPRpcServer(s *grpc.Server, srv PPRpcServer)
- func RegisterService(s *pprpc.Service, hook Rpcer)
- type PPMQConnectClient
- type PPRpcClient
- type PPRpcServer
- type Req
- func (*Req) Descriptor() ([]byte, []int)
- func (m *Req) GetAccount() string
- func (m *Req) GetClearSession() int32
- func (m *Req) GetClientId() string
- func (m *Req) GetHistorymsgCount() int32
- func (m *Req) GetHistorymsgType() int32
- func (m *Req) GetPassword() string
- func (m *Req) GetWillBody() string
- func (m *Req) GetWillFlag() uint32
- func (m *Req) GetWillQos() uint32
- func (m *Req) GetWillRetain() uint32
- func (m *Req) GetWillTopic() string
- func (*Req) ProtoMessage()
- func (m *Req) Reset()
- func (m *Req) String() string
- func (m *Req) XXX_DiscardUnknown()
- func (m *Req) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Req) XXX_Merge(src proto.Message)
- func (m *Req) XXX_Size() int
- func (m *Req) XXX_Unmarshal(b []byte) error
- type Resp
- func (*Resp) Descriptor() ([]byte, []int)
- func (m *Resp) GetCode() uint32
- func (m *Resp) GetHbInterval() uint32
- func (m *Resp) GetSp() uint32
- func (*Resp) ProtoMessage()
- func (m *Resp) Reset()
- func (m *Resp) String() string
- func (m *Resp) XXX_DiscardUnknown()
- func (m *Resp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Resp) XXX_Merge(src proto.Message)
- func (m *Resp) XXX_Size() int
- func (m *Resp) XXX_Unmarshal(b []byte) error
- type Rpcer
Constants ¶
View Source
const ( CmdID uint64 = 12 CmdName string = "PPMQConnect" Module string = "ppmqd" )
Variables ¶
This section is empty.
Functions ¶
func RegisterPPRpcServer ¶
func RegisterPPRpcServer(s *grpc.Server, srv PPRpcServer)
Types ¶
type PPMQConnectClient ¶
type PPMQConnectClient interface {
PPCall(ctx context.Context, in *Req) (*Resp, *packets.CmdPacket, error)
}
func NewPPMQConnectClient ¶
func NewPPMQConnectClient(cc pprpc.RPCCliConn) PPMQConnectClient
type PPRpcClient ¶
type PPRpcClient interface {
PCall(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
}
PPRpcClient is the client API for PPRpc service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPPRpcClient ¶
func NewPPRpcClient(cc *grpc.ClientConn) PPRpcClient
type PPRpcServer ¶
PPRpcServer is the server API for PPRpc service.
type Req ¶
type Req struct { Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password"` ClientId string `protobuf:"bytes,3,opt,name=client_id,json=clientId,proto3" json:"client_id"` // 当前连接是否需要获取离线记录; 1 不获取,只用于接收新消息; 2 只用于获取离线消息; 3 同时获取新消息和离线消息. HistorymsgType int32 `protobuf:"varint,4,opt,name=historymsg_type,json=historymsgType,proto3" json:"historymsg_type"` // 可以设定获取离线消息的数量,默认是5条;0 表示获取所有(historymsg_type = 2,3) HistorymsgCount int32 `protobuf:"varint,5,opt,name=historymsg_count,json=historymsgCount,proto3" json:"historymsg_count"` // 0: 表示记录该ClientID的订阅信息以及服务QOS1,2的消息,在该ClientID上线后再推送该消息给对方. // 1: 会话仅仅维持当前连接(订阅信息会清除) ClearSession int32 `protobuf:"varint,6,opt,name=clear_session,json=clearSession,proto3" json:"clear_session"` // 1:发布一条遗嘱消息 WillFlag uint32 `protobuf:"varint,9,opt,name=will_flag,json=willFlag,proto3" json:"will_flag"` // 遗嘱消息的QOS WillQos uint32 `protobuf:"varint,10,opt,name=will_qos,json=willQos,proto3" json:"will_qos"` // 是否保留遗嘱消息.1 当作保留信息发布;0 非保留信息发布. WillRetain uint32 `protobuf:"varint,11,opt,name=will_retain,json=willRetain,proto3" json:"will_retain"` // 遗嘱主题/消息 WillTopic string `protobuf:"bytes,12,opt,name=will_topic,json=willTopic,proto3" json:"will_topic"` WillBody string `protobuf:"bytes,13,opt,name=will_body,json=willBody,proto3" json:"will_body"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Reqest
func (*Req) Descriptor ¶
func (*Req) GetAccount ¶
func (*Req) GetClearSession ¶
func (*Req) GetClientId ¶
func (*Req) GetHistorymsgCount ¶
func (*Req) GetHistorymsgType ¶
func (*Req) GetPassword ¶
func (*Req) GetWillBody ¶
func (*Req) GetWillFlag ¶
func (*Req) GetWillQos ¶
func (*Req) GetWillRetain ¶
func (*Req) GetWillTopic ¶
func (*Req) ProtoMessage ¶
func (*Req) ProtoMessage()
func (*Req) XXX_DiscardUnknown ¶
func (m *Req) XXX_DiscardUnknown()
func (*Req) XXX_Unmarshal ¶
type Resp ¶
type Resp struct { // 0 : 如果连接使用的TCP则使用请求时的值作为心跳间隔;如果是UDP则自动探测UDP的生存时间. // 1-65535: TCP/UDP, 使用返回的值作为心跳间隔; HbInterval uint32 `protobuf:"varint,11,opt,name=hb_interval,json=hbInterval,proto3" json:"hb_interval"` // 连接确认标志(参见MQTT的 CONNACK的说明) Sp uint32 `protobuf:"varint,12,opt,name=sp,proto3" json:"sp"` // 参见MQTT的CONNACK的返回码定义 Code uint32 `protobuf:"varint,13,opt,name=code,proto3" json:"code"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Response
func (*Resp) Descriptor ¶
func (*Resp) GetHbInterval ¶
func (*Resp) ProtoMessage ¶
func (*Resp) ProtoMessage()
func (*Resp) XXX_DiscardUnknown ¶
func (m *Resp) XXX_DiscardUnknown()
func (*Resp) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.