Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)
- type CMDEvent
- type CMDReq
- type CMDResp
- type CMDType
- type ForwardRecvPacketReq
- func (*ForwardRecvPacketReq) Descriptor() ([]byte, []int)deprecated
- func (x *ForwardRecvPacketReq) GetFromDeviceFlag() int32
- func (x *ForwardRecvPacketReq) GetMessage() []byte
- func (x *ForwardRecvPacketReq) GetNo() string
- func (x *ForwardRecvPacketReq) GetUsers() []string
- func (*ForwardRecvPacketReq) ProtoMessage()
- func (x *ForwardRecvPacketReq) ProtoReflect() protoreflect.Message
- func (x *ForwardRecvPacketReq) Reset()
- func (x *ForwardRecvPacketReq) String() string
- type ForwardSendPacketReq
- func (*ForwardSendPacketReq) Descriptor() ([]byte, []int)deprecated
- func (x *ForwardSendPacketReq) GetFromDeviceFlag() int32
- func (x *ForwardSendPacketReq) GetFromUID() string
- func (x *ForwardSendPacketReq) GetSendPacket() []byte
- func (*ForwardSendPacketReq) ProtoMessage()
- func (x *ForwardSendPacketReq) ProtoReflect() protoreflect.Message
- func (x *ForwardSendPacketReq) Reset()
- func (x *ForwardSendPacketReq) String() string
- type ForwardSendPacketResp
- func (*ForwardSendPacketResp) Descriptor() ([]byte, []int)deprecated
- func (x *ForwardSendPacketResp) GetMessageID() int64
- func (x *ForwardSendPacketResp) GetMessageSeq() int32
- func (x *ForwardSendPacketResp) GetReasonCode() int32
- func (*ForwardSendPacketResp) ProtoMessage()
- func (x *ForwardSendPacketResp) ProtoReflect() protoreflect.Message
- func (x *ForwardSendPacketResp) Reset()
- func (x *ForwardSendPacketResp) String() string
- type GetChannelMessageSeqReq
- func (*GetChannelMessageSeqReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetChannelMessageSeqReq) GetChannelID() string
- func (x *GetChannelMessageSeqReq) GetChannelType() int32
- func (*GetChannelMessageSeqReq) ProtoMessage()
- func (x *GetChannelMessageSeqReq) ProtoReflect() protoreflect.Message
- func (x *GetChannelMessageSeqReq) Reset()
- func (x *GetChannelMessageSeqReq) String() string
- type GetChannelMessageSeqResp
- func (*GetChannelMessageSeqResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetChannelMessageSeqResp) GetMessageSeq() int32
- func (*GetChannelMessageSeqResp) ProtoMessage()
- func (x *GetChannelMessageSeqResp) ProtoReflect() protoreflect.Message
- func (x *GetChannelMessageSeqResp) Reset()
- func (x *GetChannelMessageSeqResp) String() string
- type GetSubscribersReq
- func (*GetSubscribersReq) Descriptor() ([]byte, []int)deprecated
- func (x *GetSubscribersReq) GetChannelID() string
- func (x *GetSubscribersReq) GetChannelType() int32
- func (*GetSubscribersReq) ProtoMessage()
- func (x *GetSubscribersReq) ProtoReflect() protoreflect.Message
- func (x *GetSubscribersReq) Reset()
- func (x *GetSubscribersReq) String() string
- type GetSubscribersResp
- func (*GetSubscribersResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetSubscribersResp) GetSubscribers() []string
- func (*GetSubscribersResp) ProtoMessage()
- func (x *GetSubscribersResp) ProtoReflect() protoreflect.Message
- func (x *GetSubscribersResp) Reset()
- func (x *GetSubscribersResp) String() string
- type NodeServiceClient
- type NodeServiceServer
- type Server
- type Status
- type UnimplementedNodeServiceServer
- type UnsafeNodeServiceServer
Constants ¶
const (
// CMDTypeForwardSendPacket 转发发送包
CMDTypeForwardSendPacket = 1001
)
Variables ¶
var ( CMDType_name = map[int32]string{ 0: "None", 1: "ForwardSendPacket", 2: "ForwardRecvPacket", 3: "GetSubscribers", 4: "GenChannelMessageSeq", } CMDType_value = map[string]int32{ "None": 0, "ForwardSendPacket": 1, "ForwardRecvPacket": 2, "GetSubscribers": 3, "GenChannelMessageSeq": 4, } )
Enum value maps for CMDType.
var ( Status_name = map[int32]string{ 0: "Error", 1: "Success", } Status_value = map[string]int32{ "Error": 0, "Success": 1, } )
Enum value maps for Status.
var File_internal_lim_rpc_service_proto protoreflect.FileDescriptor
var NodeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rpc.NodeService", HandlerType: (*NodeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendCMD", Handler: _NodeService_SendCMD_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "internal/lim/rpc/service.proto", }
NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNodeServiceServer ¶
func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)
Types ¶
type CMDEvent ¶
type CMDEvent interface { // 收到发送包 OnSendPacket(fromUID string, deviceFlag lmproto.DeviceFlag, sendPacket *lmproto.SendPacket) (messageID int64, messageSeq uint32, reasonCode lmproto.ReasonCode, err error) // 收到接受包 OnRecvPacket(deviceFlag lmproto.DeviceFlag, recvPacket *lmproto.RecvPacket, users []string) error // 获取频道订阅者 OnGetSubscribers(channelID string, channelType uint8) ([]string, error) // 获取频道的消息序号 OnGetChannelMessageSeq(channelID string, channelType uint8) (uint32, error) }
CMDEvent cmd事件
type CMDReq ¶
type CMDReq struct { Cmd CMDType `protobuf:"varint,1,opt,name=cmd,proto3,enum=rpc.CMDType" json:"cmd,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CMDReq) Descriptor
deprecated
func (*CMDReq) ProtoMessage ¶
func (*CMDReq) ProtoMessage()
func (*CMDReq) ProtoReflect ¶
func (x *CMDReq) ProtoReflect() protoreflect.Message
type CMDResp ¶
type CMDResp struct { Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=rpc.Status" json:"status,omitempty"` // 请求唯一ID Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // 返回数据 // contains filtered or unexported fields }
func (*CMDResp) Descriptor
deprecated
func (*CMDResp) ProtoMessage ¶
func (*CMDResp) ProtoMessage()
func (*CMDResp) ProtoReflect ¶
func (x *CMDResp) ProtoReflect() protoreflect.Message
type CMDType ¶
type CMDType int32
func (CMDType) Descriptor ¶
func (CMDType) Descriptor() protoreflect.EnumDescriptor
func (CMDType) EnumDescriptor
deprecated
func (CMDType) Number ¶
func (x CMDType) Number() protoreflect.EnumNumber
func (CMDType) Type ¶
func (CMDType) Type() protoreflect.EnumType
type ForwardRecvPacketReq ¶
type ForwardRecvPacketReq struct { No string `protobuf:"bytes,1,opt,name=no,proto3" json:"no,omitempty"` // 此次请求的唯一编号 Users []string `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` // 用户 Message []byte `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // 对应的消息 FromDeviceFlag int32 `protobuf:"varint,4,opt,name=fromDeviceFlag,proto3" json:"fromDeviceFlag,omitempty"` // 发送者的设备标记 // contains filtered or unexported fields }
func (*ForwardRecvPacketReq) Descriptor
deprecated
func (*ForwardRecvPacketReq) Descriptor() ([]byte, []int)
Deprecated: Use ForwardRecvPacketReq.ProtoReflect.Descriptor instead.
func (*ForwardRecvPacketReq) GetFromDeviceFlag ¶
func (x *ForwardRecvPacketReq) GetFromDeviceFlag() int32
func (*ForwardRecvPacketReq) GetMessage ¶
func (x *ForwardRecvPacketReq) GetMessage() []byte
func (*ForwardRecvPacketReq) GetNo ¶
func (x *ForwardRecvPacketReq) GetNo() string
func (*ForwardRecvPacketReq) GetUsers ¶
func (x *ForwardRecvPacketReq) GetUsers() []string
func (*ForwardRecvPacketReq) ProtoMessage ¶
func (*ForwardRecvPacketReq) ProtoMessage()
func (*ForwardRecvPacketReq) ProtoReflect ¶
func (x *ForwardRecvPacketReq) ProtoReflect() protoreflect.Message
func (*ForwardRecvPacketReq) Reset ¶
func (x *ForwardRecvPacketReq) Reset()
func (*ForwardRecvPacketReq) String ¶
func (x *ForwardRecvPacketReq) String() string
type ForwardSendPacketReq ¶
type ForwardSendPacketReq struct { SendPacket []byte `protobuf:"bytes,1,opt,name=sendPacket,proto3" json:"sendPacket,omitempty"` // 发送包 FromUID string `protobuf:"bytes,2,opt,name=fromUID,proto3" json:"fromUID,omitempty"` // 发送者UID FromDeviceFlag int32 `protobuf:"varint,3,opt,name=fromDeviceFlag,proto3" json:"fromDeviceFlag,omitempty"` // 发送者的设备标记 // contains filtered or unexported fields }
func (*ForwardSendPacketReq) Descriptor
deprecated
func (*ForwardSendPacketReq) Descriptor() ([]byte, []int)
Deprecated: Use ForwardSendPacketReq.ProtoReflect.Descriptor instead.
func (*ForwardSendPacketReq) GetFromDeviceFlag ¶
func (x *ForwardSendPacketReq) GetFromDeviceFlag() int32
func (*ForwardSendPacketReq) GetFromUID ¶
func (x *ForwardSendPacketReq) GetFromUID() string
func (*ForwardSendPacketReq) GetSendPacket ¶
func (x *ForwardSendPacketReq) GetSendPacket() []byte
func (*ForwardSendPacketReq) ProtoMessage ¶
func (*ForwardSendPacketReq) ProtoMessage()
func (*ForwardSendPacketReq) ProtoReflect ¶
func (x *ForwardSendPacketReq) ProtoReflect() protoreflect.Message
func (*ForwardSendPacketReq) Reset ¶
func (x *ForwardSendPacketReq) Reset()
func (*ForwardSendPacketReq) String ¶
func (x *ForwardSendPacketReq) String() string
type ForwardSendPacketResp ¶
type ForwardSendPacketResp struct { MessageID int64 `protobuf:"varint,1,opt,name=messageID,proto3" json:"messageID,omitempty"` // 消息唯一ID ReasonCode int32 `protobuf:"varint,2,opt,name=reasonCode,proto3" json:"reasonCode,omitempty"` // 发送原因码 MessageSeq int32 `protobuf:"varint,3,opt,name=messageSeq,proto3" json:"messageSeq,omitempty"` // 消息编号 // contains filtered or unexported fields }
func (*ForwardSendPacketResp) Descriptor
deprecated
func (*ForwardSendPacketResp) Descriptor() ([]byte, []int)
Deprecated: Use ForwardSendPacketResp.ProtoReflect.Descriptor instead.
func (*ForwardSendPacketResp) GetMessageID ¶
func (x *ForwardSendPacketResp) GetMessageID() int64
func (*ForwardSendPacketResp) GetMessageSeq ¶
func (x *ForwardSendPacketResp) GetMessageSeq() int32
func (*ForwardSendPacketResp) GetReasonCode ¶
func (x *ForwardSendPacketResp) GetReasonCode() int32
func (*ForwardSendPacketResp) ProtoMessage ¶
func (*ForwardSendPacketResp) ProtoMessage()
func (*ForwardSendPacketResp) ProtoReflect ¶
func (x *ForwardSendPacketResp) ProtoReflect() protoreflect.Message
func (*ForwardSendPacketResp) Reset ¶
func (x *ForwardSendPacketResp) Reset()
func (*ForwardSendPacketResp) String ¶
func (x *ForwardSendPacketResp) String() string
type GetChannelMessageSeqReq ¶
type GetChannelMessageSeqReq struct { ChannelID string `protobuf:"bytes,1,opt,name=channelID,proto3" json:"channelID,omitempty"` ChannelType int32 `protobuf:"varint,2,opt,name=channelType,proto3" json:"channelType,omitempty"` // contains filtered or unexported fields }
func (*GetChannelMessageSeqReq) Descriptor
deprecated
func (*GetChannelMessageSeqReq) Descriptor() ([]byte, []int)
Deprecated: Use GetChannelMessageSeqReq.ProtoReflect.Descriptor instead.
func (*GetChannelMessageSeqReq) GetChannelID ¶
func (x *GetChannelMessageSeqReq) GetChannelID() string
func (*GetChannelMessageSeqReq) GetChannelType ¶
func (x *GetChannelMessageSeqReq) GetChannelType() int32
func (*GetChannelMessageSeqReq) ProtoMessage ¶
func (*GetChannelMessageSeqReq) ProtoMessage()
func (*GetChannelMessageSeqReq) ProtoReflect ¶
func (x *GetChannelMessageSeqReq) ProtoReflect() protoreflect.Message
func (*GetChannelMessageSeqReq) Reset ¶
func (x *GetChannelMessageSeqReq) Reset()
func (*GetChannelMessageSeqReq) String ¶
func (x *GetChannelMessageSeqReq) String() string
type GetChannelMessageSeqResp ¶
type GetChannelMessageSeqResp struct { MessageSeq int32 `protobuf:"varint,1,opt,name=messageSeq,proto3" json:"messageSeq,omitempty"` // 消息编号 // contains filtered or unexported fields }
func (*GetChannelMessageSeqResp) Descriptor
deprecated
func (*GetChannelMessageSeqResp) Descriptor() ([]byte, []int)
Deprecated: Use GetChannelMessageSeqResp.ProtoReflect.Descriptor instead.
func (*GetChannelMessageSeqResp) GetMessageSeq ¶
func (x *GetChannelMessageSeqResp) GetMessageSeq() int32
func (*GetChannelMessageSeqResp) ProtoMessage ¶
func (*GetChannelMessageSeqResp) ProtoMessage()
func (*GetChannelMessageSeqResp) ProtoReflect ¶
func (x *GetChannelMessageSeqResp) ProtoReflect() protoreflect.Message
func (*GetChannelMessageSeqResp) Reset ¶
func (x *GetChannelMessageSeqResp) Reset()
func (*GetChannelMessageSeqResp) String ¶
func (x *GetChannelMessageSeqResp) String() string
type GetSubscribersReq ¶
type GetSubscribersReq struct { ChannelID string `protobuf:"bytes,1,opt,name=channelID,proto3" json:"channelID,omitempty"` ChannelType int32 `protobuf:"varint,2,opt,name=channelType,proto3" json:"channelType,omitempty"` // contains filtered or unexported fields }
func (*GetSubscribersReq) Descriptor
deprecated
func (*GetSubscribersReq) Descriptor() ([]byte, []int)
Deprecated: Use GetSubscribersReq.ProtoReflect.Descriptor instead.
func (*GetSubscribersReq) GetChannelID ¶
func (x *GetSubscribersReq) GetChannelID() string
func (*GetSubscribersReq) GetChannelType ¶
func (x *GetSubscribersReq) GetChannelType() int32
func (*GetSubscribersReq) ProtoMessage ¶
func (*GetSubscribersReq) ProtoMessage()
func (*GetSubscribersReq) ProtoReflect ¶
func (x *GetSubscribersReq) ProtoReflect() protoreflect.Message
func (*GetSubscribersReq) Reset ¶
func (x *GetSubscribersReq) Reset()
func (*GetSubscribersReq) String ¶
func (x *GetSubscribersReq) String() string
type GetSubscribersResp ¶
type GetSubscribersResp struct { Subscribers []string `protobuf:"bytes,1,rep,name=subscribers,proto3" json:"subscribers,omitempty"` // contains filtered or unexported fields }
func (*GetSubscribersResp) Descriptor
deprecated
func (*GetSubscribersResp) Descriptor() ([]byte, []int)
Deprecated: Use GetSubscribersResp.ProtoReflect.Descriptor instead.
func (*GetSubscribersResp) GetSubscribers ¶
func (x *GetSubscribersResp) GetSubscribers() []string
func (*GetSubscribersResp) ProtoMessage ¶
func (*GetSubscribersResp) ProtoMessage()
func (*GetSubscribersResp) ProtoReflect ¶
func (x *GetSubscribersResp) ProtoReflect() protoreflect.Message
func (*GetSubscribersResp) Reset ¶
func (x *GetSubscribersResp) Reset()
func (*GetSubscribersResp) String ¶
func (x *GetSubscribersResp) String() string
type NodeServiceClient ¶
type NodeServiceClient interface { // 转发 SendCMD(ctx context.Context, in *CMDReq, opts ...grpc.CallOption) (*CMDResp, error) }
NodeServiceClient is the client API for NodeService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewNodeServiceClient ¶
func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient
type NodeServiceServer ¶
type NodeServiceServer interface { // 转发 SendCMD(context.Context, *CMDReq) (*CMDResp, error) // contains filtered or unexported methods }
NodeServiceServer is the server API for NodeService service. All implementations must embed UnimplementedNodeServiceServer for forward compatibility
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type UnimplementedNodeServiceServer ¶
type UnimplementedNodeServiceServer struct { }
UnimplementedNodeServiceServer must be embedded to have forward compatible implementations.
type UnsafeNodeServiceServer ¶
type UnsafeNodeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeServiceServer will result in compilation errors.