Documentation
¶
Index ¶
- Variables
- func RegisterMessageClientServer(s grpc.ServiceRegistrar, srv MessageClientServer)
- type ChatMsg
- func (*ChatMsg) Descriptor() ([]byte, []int)deprecated
- func (x *ChatMsg) GetContent() string
- func (x *ChatMsg) GetCreateTime() int64
- func (x *ChatMsg) GetGroupId() string
- func (x *ChatMsg) GetId() int64
- func (x *ChatMsg) GetSenderId() int64
- func (x *ChatMsg) GetType() int64
- func (x *ChatMsg) GetUuid() string
- func (*ChatMsg) ProtoMessage()
- func (x *ChatMsg) ProtoReflect() protoreflect.Message
- func (x *ChatMsg) Reset()
- func (x *ChatMsg) String() string
- type MessageClientClient
- type MessageClientServer
- type PullRequest
- func (*PullRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PullRequest) GetGroupId() string
- func (x *PullRequest) GetMaxMsgId() int64
- func (x *PullRequest) GetPlatform() string
- func (x *PullRequest) GetUserId() int64
- func (*PullRequest) ProtoMessage()
- func (x *PullRequest) ProtoReflect() protoreflect.Message
- func (x *PullRequest) Reset()
- func (x *PullRequest) String() string
- type PullResponse
- type UnimplementedMessageClientServer
- type UnsafeMessageClientServer
- type UploadRequest
- func (*UploadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UploadRequest) GetContent() string
- func (x *UploadRequest) GetGroupId() string
- func (x *UploadRequest) GetSenderId() int64
- func (x *UploadRequest) GetType() int64
- func (x *UploadRequest) GetUuid() string
- func (*UploadRequest) ProtoMessage()
- func (x *UploadRequest) ProtoReflect() protoreflect.Message
- func (x *UploadRequest) Reset()
- func (x *UploadRequest) String() string
- type UploadResponse
- func (*UploadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UploadResponse) GetCreateTime() int64
- func (x *UploadResponse) GetId() int64
- func (*UploadResponse) ProtoMessage()
- func (x *UploadResponse) ProtoReflect() protoreflect.Message
- func (x *UploadResponse) Reset()
- func (x *UploadResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var File_proto_msg_msg_proto protoreflect.FileDescriptor
var MessageClient_ServiceDesc = grpc.ServiceDesc{ ServiceName: "msg.MessageClient", HandlerType: (*MessageClientServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Upload", Handler: _MessageClient_Upload_Handler, }, { MethodName: "Pull", Handler: _MessageClient_Pull_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/msg/msg.proto", }
MessageClient_ServiceDesc is the grpc.ServiceDesc for MessageClient service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMessageClientServer ¶
func RegisterMessageClientServer(s grpc.ServiceRegistrar, srv MessageClientServer)
Types ¶
type ChatMsg ¶
type ChatMsg struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 消息id GroupId string `protobuf:"bytes,2,opt,name=groupId,proto3" json:"groupId,omitempty"` // 群id SenderId int64 `protobuf:"varint,3,opt,name=senderId,proto3" json:"senderId,omitempty"` // 发送者uid Type int64 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` // 消息类型 1文本, 2图片, 3视频, 4音频 Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` // 消息内容 Uuid string `protobuf:"bytes,6,opt,name=uuid,proto3" json:"uuid,omitempty"` // 作用是去重 CreateTime int64 `protobuf:"varint,7,opt,name=createTime,proto3" json:"createTime,omitempty"` // 创建时间 // contains filtered or unexported fields }
聊天消息结构
func (*ChatMsg) Descriptor
deprecated
func (*ChatMsg) GetContent ¶
func (*ChatMsg) GetCreateTime ¶
func (*ChatMsg) GetGroupId ¶
func (*ChatMsg) GetSenderId ¶
func (*ChatMsg) ProtoMessage ¶
func (*ChatMsg) ProtoMessage()
func (*ChatMsg) ProtoReflect ¶
func (x *ChatMsg) ProtoReflect() protoreflect.Message
type MessageClientClient ¶
type MessageClientClient interface { Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) Pull(ctx context.Context, in *PullRequest, opts ...grpc.CallOption) (*PullResponse, error) }
MessageClientClient is the client API for MessageClient 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 NewMessageClientClient ¶
func NewMessageClientClient(cc grpc.ClientConnInterface) MessageClientClient
type MessageClientServer ¶
type MessageClientServer interface { Upload(context.Context, *UploadRequest) (*UploadResponse, error) Pull(context.Context, *PullRequest) (*PullResponse, error) // contains filtered or unexported methods }
MessageClientServer is the server API for MessageClient service. All implementations must embed UnimplementedMessageClientServer for forward compatibility
type PullRequest ¶
type PullRequest struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // 用户id Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` // 平台号 GroupId string `protobuf:"bytes,3,opt,name=groupId,proto3" json:"groupId,omitempty"` // 要拉取哪个群的消息 MaxMsgId int64 `protobuf:"varint,4,opt,name=maxMsgId,proto3" json:"maxMsgId,omitempty"` // 最新的消息id(从后往前拉取) // contains filtered or unexported fields }
拉取消息
func (*PullRequest) Descriptor
deprecated
func (*PullRequest) Descriptor() ([]byte, []int)
Deprecated: Use PullRequest.ProtoReflect.Descriptor instead.
func (*PullRequest) GetGroupId ¶
func (x *PullRequest) GetGroupId() string
func (*PullRequest) GetMaxMsgId ¶
func (x *PullRequest) GetMaxMsgId() int64
func (*PullRequest) GetPlatform ¶
func (x *PullRequest) GetPlatform() string
func (*PullRequest) GetUserId ¶
func (x *PullRequest) GetUserId() int64
func (*PullRequest) ProtoMessage ¶
func (*PullRequest) ProtoMessage()
func (*PullRequest) ProtoReflect ¶
func (x *PullRequest) ProtoReflect() protoreflect.Message
func (*PullRequest) Reset ¶
func (x *PullRequest) Reset()
func (*PullRequest) String ¶
func (x *PullRequest) String() string
type PullResponse ¶
type PullResponse struct { List []*ChatMsg `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
func (*PullResponse) Descriptor
deprecated
func (*PullResponse) Descriptor() ([]byte, []int)
Deprecated: Use PullResponse.ProtoReflect.Descriptor instead.
func (*PullResponse) GetList ¶
func (x *PullResponse) GetList() []*ChatMsg
func (*PullResponse) ProtoMessage ¶
func (*PullResponse) ProtoMessage()
func (*PullResponse) ProtoReflect ¶
func (x *PullResponse) ProtoReflect() protoreflect.Message
func (*PullResponse) Reset ¶
func (x *PullResponse) Reset()
func (*PullResponse) String ¶
func (x *PullResponse) String() string
type UnimplementedMessageClientServer ¶
type UnimplementedMessageClientServer struct { }
UnimplementedMessageClientServer must be embedded to have forward compatible implementations.
func (UnimplementedMessageClientServer) Pull ¶
func (UnimplementedMessageClientServer) Pull(context.Context, *PullRequest) (*PullResponse, error)
func (UnimplementedMessageClientServer) Upload ¶
func (UnimplementedMessageClientServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error)
type UnsafeMessageClientServer ¶
type UnsafeMessageClientServer interface {
// contains filtered or unexported methods
}
UnsafeMessageClientServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MessageClientServer will result in compilation errors.
type UploadRequest ¶
type UploadRequest struct { GroupId string `protobuf:"bytes,1,opt,name=groupId,proto3" json:"groupId,omitempty"` SenderId int64 `protobuf:"varint,2,opt,name=senderId,proto3" json:"senderId,omitempty"` Type int64 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` Uuid string `protobuf:"bytes,5,opt,name=uuid,proto3" json:"uuid,omitempty"` // contains filtered or unexported fields }
上传消息
func (*UploadRequest) Descriptor
deprecated
func (*UploadRequest) Descriptor() ([]byte, []int)
Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.
func (*UploadRequest) GetContent ¶
func (x *UploadRequest) GetContent() string
func (*UploadRequest) GetGroupId ¶
func (x *UploadRequest) GetGroupId() string
func (*UploadRequest) GetSenderId ¶
func (x *UploadRequest) GetSenderId() int64
func (*UploadRequest) GetType ¶
func (x *UploadRequest) GetType() int64
func (*UploadRequest) GetUuid ¶
func (x *UploadRequest) GetUuid() string
func (*UploadRequest) ProtoMessage ¶
func (*UploadRequest) ProtoMessage()
func (*UploadRequest) ProtoReflect ¶
func (x *UploadRequest) ProtoReflect() protoreflect.Message
func (*UploadRequest) Reset ¶
func (x *UploadRequest) Reset()
func (*UploadRequest) String ¶
func (x *UploadRequest) String() string
type UploadResponse ¶
type UploadResponse struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` CreateTime int64 `protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime,omitempty"` // 创建时间 // contains filtered or unexported fields }
func (*UploadResponse) Descriptor
deprecated
func (*UploadResponse) Descriptor() ([]byte, []int)
Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.
func (*UploadResponse) GetCreateTime ¶
func (x *UploadResponse) GetCreateTime() int64
func (*UploadResponse) GetId ¶
func (x *UploadResponse) GetId() int64
func (*UploadResponse) ProtoMessage ¶
func (*UploadResponse) ProtoMessage()
func (*UploadResponse) ProtoReflect ¶
func (x *UploadResponse) ProtoReflect() protoreflect.Message
func (*UploadResponse) Reset ¶
func (x *UploadResponse) Reset()
func (*UploadResponse) String ¶
func (x *UploadResponse) String() string