chore: auto-generate protobuf files [skip ci]
This commit is contained in:
227
gen/chat/chat.ts
Normal file
227
gen/chat/chat.ts
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-ts_proto v2.11.6
|
||||||
|
// protoc v4.25.9
|
||||||
|
// source: chat/chat.proto
|
||||||
|
|
||||||
|
/* eslint-disable */
|
||||||
|
import type { Metadata } from "@grpc/grpc-js";
|
||||||
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
|
export const protobufPackage = "chat.v1";
|
||||||
|
|
||||||
|
export interface MessageDto {
|
||||||
|
id: string;
|
||||||
|
chatId: string;
|
||||||
|
senderId: string;
|
||||||
|
/** TEXT, VOICE, VIDEO_NOTE, STICKER */
|
||||||
|
type: string;
|
||||||
|
content: string;
|
||||||
|
/** JSON string */
|
||||||
|
metadata: string;
|
||||||
|
replyToId: string;
|
||||||
|
isEdited: boolean;
|
||||||
|
createdAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChatDto {
|
||||||
|
id: string;
|
||||||
|
/** DIRECT, GROUP, CHANNEL */
|
||||||
|
type: string;
|
||||||
|
title: string;
|
||||||
|
avatarUrl: string;
|
||||||
|
unreadCount: number;
|
||||||
|
/** Нужно для рендера списка чатов слева! */
|
||||||
|
lastMessage: MessageDto | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateChatRequest {
|
||||||
|
/** ID того кто создает */
|
||||||
|
creatorId: string;
|
||||||
|
/** GROUP, DIRECT, CHANNEL */
|
||||||
|
type: string;
|
||||||
|
/** Имя (при type=GROUP|CHANNEL) */
|
||||||
|
title: string;
|
||||||
|
/** Кого сразу добавить (собеседник в личке или юзеры в группе) */
|
||||||
|
participantIds: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateChatResponse {
|
||||||
|
chat: ChatDto | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetUserChatsRequest {
|
||||||
|
userId: string;
|
||||||
|
/** для пагинации (бесконечный скролл в левой панели) */
|
||||||
|
offset: number;
|
||||||
|
limit: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetUserChatsResponse {
|
||||||
|
chats: ChatDto[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface JoinChatRequest {
|
||||||
|
userId: string;
|
||||||
|
/** либо join_hash */
|
||||||
|
chatId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface JoinChatResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LeaveChatRequest {
|
||||||
|
userId: string;
|
||||||
|
chatId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LeaveChatResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetMessagesRequest {
|
||||||
|
userId: string;
|
||||||
|
chatId: string;
|
||||||
|
limit: number;
|
||||||
|
/** курсорная пагинация, как в Telegram */
|
||||||
|
beforeMsgId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetMessagesResponse {
|
||||||
|
messages: MessageDto[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SendMessageRequest {
|
||||||
|
chatId: string;
|
||||||
|
senderId: string;
|
||||||
|
type: string;
|
||||||
|
content: string;
|
||||||
|
replyToId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteMessageRequest {
|
||||||
|
userId: string;
|
||||||
|
messageId: string;
|
||||||
|
/** "Удалить для всех" */
|
||||||
|
forEveryone: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteMessageResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MarkAsReadRequest {
|
||||||
|
userId: string;
|
||||||
|
chatId: string;
|
||||||
|
messageId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MarkAsReadResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CHAT_V1_PACKAGE_NAME = "chat.v1";
|
||||||
|
|
||||||
|
export interface ChatServiceClient {
|
||||||
|
/** Управление чатами */
|
||||||
|
|
||||||
|
createChat(request: CreateChatRequest, metadata?: Metadata): Observable<CreateChatResponse>;
|
||||||
|
|
||||||
|
getUserChats(request: GetUserChatsRequest, metadata?: Metadata): Observable<GetUserChatsResponse>;
|
||||||
|
|
||||||
|
joinChat(request: JoinChatRequest, metadata?: Metadata): Observable<JoinChatResponse>;
|
||||||
|
|
||||||
|
leaveChat(request: LeaveChatRequest, metadata?: Metadata): Observable<LeaveChatResponse>;
|
||||||
|
|
||||||
|
/** Управление сообщениями (история) */
|
||||||
|
|
||||||
|
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
||||||
|
|
||||||
|
/** вызывается либо из Gateway (для фото/аудио), либо напрямую */
|
||||||
|
|
||||||
|
sendMessage(request: SendMessageRequest, metadata?: Metadata): Observable<MessageDto>;
|
||||||
|
|
||||||
|
deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<DeleteMessageResponse>;
|
||||||
|
|
||||||
|
/** Статусы */
|
||||||
|
|
||||||
|
markAsRead(request: MarkAsReadRequest, metadata?: Metadata): Observable<MarkAsReadResponse>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChatServiceController {
|
||||||
|
/** Управление чатами */
|
||||||
|
|
||||||
|
createChat(
|
||||||
|
request: CreateChatRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<CreateChatResponse> | Observable<CreateChatResponse> | CreateChatResponse;
|
||||||
|
|
||||||
|
getUserChats(
|
||||||
|
request: GetUserChatsRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<GetUserChatsResponse> | Observable<GetUserChatsResponse> | GetUserChatsResponse;
|
||||||
|
|
||||||
|
joinChat(
|
||||||
|
request: JoinChatRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<JoinChatResponse> | Observable<JoinChatResponse> | JoinChatResponse;
|
||||||
|
|
||||||
|
leaveChat(
|
||||||
|
request: LeaveChatRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<LeaveChatResponse> | Observable<LeaveChatResponse> | LeaveChatResponse;
|
||||||
|
|
||||||
|
/** Управление сообщениями (история) */
|
||||||
|
|
||||||
|
getMessages(
|
||||||
|
request: GetMessagesRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<GetMessagesResponse> | Observable<GetMessagesResponse> | GetMessagesResponse;
|
||||||
|
|
||||||
|
/** вызывается либо из Gateway (для фото/аудио), либо напрямую */
|
||||||
|
|
||||||
|
sendMessage(
|
||||||
|
request: SendMessageRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<MessageDto> | Observable<MessageDto> | MessageDto;
|
||||||
|
|
||||||
|
deleteMessage(
|
||||||
|
request: DeleteMessageRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<DeleteMessageResponse> | Observable<DeleteMessageResponse> | DeleteMessageResponse;
|
||||||
|
|
||||||
|
/** Статусы */
|
||||||
|
|
||||||
|
markAsRead(
|
||||||
|
request: MarkAsReadRequest,
|
||||||
|
metadata?: Metadata,
|
||||||
|
): Promise<MarkAsReadResponse> | Observable<MarkAsReadResponse> | MarkAsReadResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ChatServiceControllerMethods() {
|
||||||
|
return function (constructor: Function) {
|
||||||
|
const grpcMethods: string[] = [
|
||||||
|
"createChat",
|
||||||
|
"getUserChats",
|
||||||
|
"joinChat",
|
||||||
|
"leaveChat",
|
||||||
|
"getMessages",
|
||||||
|
"sendMessage",
|
||||||
|
"deleteMessage",
|
||||||
|
"markAsRead",
|
||||||
|
];
|
||||||
|
for (const method of grpcMethods) {
|
||||||
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||||
|
GrpcMethod("ChatService", method)(constructor.prototype[method], method, descriptor);
|
||||||
|
}
|
||||||
|
const grpcStreamMethods: string[] = [];
|
||||||
|
for (const method of grpcStreamMethods) {
|
||||||
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||||
|
GrpcStreamMethod("ChatService", method)(constructor.prototype[method], method, descriptor);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const CHAT_SERVICE_NAME = "ChatService";
|
||||||
1190
gen/go/chat/chat.pb.go
Normal file
1190
gen/go/chat/chat.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
393
gen/go/chat/chat_grpc.pb.go
Normal file
393
gen/go/chat/chat_grpc.pb.go
Normal file
@@ -0,0 +1,393 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.6.1
|
||||||
|
// - protoc v4.25.9
|
||||||
|
// source: chat/chat.proto
|
||||||
|
|
||||||
|
package pb
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
|
const (
|
||||||
|
ChatService_CreateChat_FullMethodName = "/chat.v1.ChatService/CreateChat"
|
||||||
|
ChatService_GetUserChats_FullMethodName = "/chat.v1.ChatService/GetUserChats"
|
||||||
|
ChatService_JoinChat_FullMethodName = "/chat.v1.ChatService/JoinChat"
|
||||||
|
ChatService_LeaveChat_FullMethodName = "/chat.v1.ChatService/LeaveChat"
|
||||||
|
ChatService_GetMessages_FullMethodName = "/chat.v1.ChatService/GetMessages"
|
||||||
|
ChatService_SendMessage_FullMethodName = "/chat.v1.ChatService/SendMessage"
|
||||||
|
ChatService_DeleteMessage_FullMethodName = "/chat.v1.ChatService/DeleteMessage"
|
||||||
|
ChatService_MarkAsRead_FullMethodName = "/chat.v1.ChatService/MarkAsRead"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ChatServiceClient is the client API for ChatService 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.
|
||||||
|
type ChatServiceClient interface {
|
||||||
|
// Управление чатами
|
||||||
|
CreateChat(ctx context.Context, in *CreateChatRequest, opts ...grpc.CallOption) (*CreateChatResponse, error)
|
||||||
|
GetUserChats(ctx context.Context, in *GetUserChatsRequest, opts ...grpc.CallOption) (*GetUserChatsResponse, error)
|
||||||
|
JoinChat(ctx context.Context, in *JoinChatRequest, opts ...grpc.CallOption) (*JoinChatResponse, error)
|
||||||
|
LeaveChat(ctx context.Context, in *LeaveChatRequest, opts ...grpc.CallOption) (*LeaveChatResponse, error)
|
||||||
|
// Управление сообщениями (история)
|
||||||
|
GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
|
||||||
|
SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*MessageDto, error)
|
||||||
|
DeleteMessage(ctx context.Context, in *DeleteMessageRequest, opts ...grpc.CallOption) (*DeleteMessageResponse, error)
|
||||||
|
// Статусы
|
||||||
|
MarkAsRead(ctx context.Context, in *MarkAsReadRequest, opts ...grpc.CallOption) (*MarkAsReadResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type chatServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewChatServiceClient(cc grpc.ClientConnInterface) ChatServiceClient {
|
||||||
|
return &chatServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) CreateChat(ctx context.Context, in *CreateChatRequest, opts ...grpc.CallOption) (*CreateChatResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(CreateChatResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_CreateChat_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) GetUserChats(ctx context.Context, in *GetUserChatsRequest, opts ...grpc.CallOption) (*GetUserChatsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(GetUserChatsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_GetUserChats_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) JoinChat(ctx context.Context, in *JoinChatRequest, opts ...grpc.CallOption) (*JoinChatResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(JoinChatResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_JoinChat_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) LeaveChat(ctx context.Context, in *LeaveChatRequest, opts ...grpc.CallOption) (*LeaveChatResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(LeaveChatResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_LeaveChat_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) GetMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(GetMessagesResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_GetMessages_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*MessageDto, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(MessageDto)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_SendMessage_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) DeleteMessage(ctx context.Context, in *DeleteMessageRequest, opts ...grpc.CallOption) (*DeleteMessageResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(DeleteMessageResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_DeleteMessage_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *chatServiceClient) MarkAsRead(ctx context.Context, in *MarkAsReadRequest, opts ...grpc.CallOption) (*MarkAsReadResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(MarkAsReadResponse)
|
||||||
|
err := c.cc.Invoke(ctx, ChatService_MarkAsRead_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChatServiceServer is the server API for ChatService service.
|
||||||
|
// All implementations must embed UnimplementedChatServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
|
type ChatServiceServer interface {
|
||||||
|
// Управление чатами
|
||||||
|
CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error)
|
||||||
|
GetUserChats(context.Context, *GetUserChatsRequest) (*GetUserChatsResponse, error)
|
||||||
|
JoinChat(context.Context, *JoinChatRequest) (*JoinChatResponse, error)
|
||||||
|
LeaveChat(context.Context, *LeaveChatRequest) (*LeaveChatResponse, error)
|
||||||
|
// Управление сообщениями (история)
|
||||||
|
GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error)
|
||||||
|
SendMessage(context.Context, *SendMessageRequest) (*MessageDto, error)
|
||||||
|
DeleteMessage(context.Context, *DeleteMessageRequest) (*DeleteMessageResponse, error)
|
||||||
|
// Статусы
|
||||||
|
MarkAsRead(context.Context, *MarkAsReadRequest) (*MarkAsReadResponse, error)
|
||||||
|
mustEmbedUnimplementedChatServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedChatServiceServer must be embedded to have
|
||||||
|
// forward compatible implementations.
|
||||||
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedChatServiceServer struct{}
|
||||||
|
|
||||||
|
func (UnimplementedChatServiceServer) CreateChat(context.Context, *CreateChatRequest) (*CreateChatResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method CreateChat not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) GetUserChats(context.Context, *GetUserChatsRequest) (*GetUserChatsResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetUserChats not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) JoinChat(context.Context, *JoinChatRequest) (*JoinChatResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method JoinChat not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) LeaveChat(context.Context, *LeaveChatRequest) (*LeaveChatResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method LeaveChat not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method GetMessages not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) SendMessage(context.Context, *SendMessageRequest) (*MessageDto, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method SendMessage not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) DeleteMessage(context.Context, *DeleteMessageRequest) (*DeleteMessageResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method DeleteMessage not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) MarkAsRead(context.Context, *MarkAsReadRequest) (*MarkAsReadResponse, error) {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "method MarkAsRead not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedChatServiceServer) mustEmbedUnimplementedChatServiceServer() {}
|
||||||
|
func (UnimplementedChatServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafeChatServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ChatServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeChatServiceServer interface {
|
||||||
|
mustEmbedUnimplementedChatServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer) {
|
||||||
|
// If the following call panics, it indicates UnimplementedChatServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
|
s.RegisterService(&ChatService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_CreateChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateChatRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).CreateChat(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_CreateChat_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).CreateChat(ctx, req.(*CreateChatRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_GetUserChats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetUserChatsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).GetUserChats(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_GetUserChats_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).GetUserChats(ctx, req.(*GetUserChatsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_JoinChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(JoinChatRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).JoinChat(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_JoinChat_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).JoinChat(ctx, req.(*JoinChatRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_LeaveChat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(LeaveChatRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).LeaveChat(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_LeaveChat_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).LeaveChat(ctx, req.(*LeaveChatRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_GetMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetMessagesRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).GetMessages(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_GetMessages_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).GetMessages(ctx, req.(*GetMessagesRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SendMessageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).SendMessage(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_SendMessage_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).SendMessage(ctx, req.(*SendMessageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_DeleteMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteMessageRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).DeleteMessage(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_DeleteMessage_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).DeleteMessage(ctx, req.(*DeleteMessageRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _ChatService_MarkAsRead_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(MarkAsReadRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(ChatServiceServer).MarkAsRead(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ChatService_MarkAsRead_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(ChatServiceServer).MarkAsRead(ctx, req.(*MarkAsReadRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var ChatService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "chat.v1.ChatService",
|
||||||
|
HandlerType: (*ChatServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CreateChat",
|
||||||
|
Handler: _ChatService_CreateChat_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetUserChats",
|
||||||
|
Handler: _ChatService_GetUserChats_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "JoinChat",
|
||||||
|
Handler: _ChatService_JoinChat_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "LeaveChat",
|
||||||
|
Handler: _ChatService_LeaveChat_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetMessages",
|
||||||
|
Handler: _ChatService_GetMessages_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SendMessage",
|
||||||
|
Handler: _ChatService_SendMessage_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteMessage",
|
||||||
|
Handler: _ChatService_DeleteMessage_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "MarkAsRead",
|
||||||
|
Handler: _ChatService_MarkAsRead_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "chat/chat.proto",
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user