Skip to content

Commit

Permalink
Комментарии к ручкам
Browse files Browse the repository at this point in the history
  • Loading branch information
xeeetu committed Aug 16, 2024
1 parent c027c5b commit 58a4c5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/chat_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type server struct {
desc.UnimplementedChatV1Server
}

// Create создаёт чат, получает массив пользователей
func (s *server) Create(ctx context.Context, in *desc.CreateRequest) (*desc.CreateResponse, error) {
select {
case <-ctx.Done():
Expand All @@ -34,6 +35,7 @@ func (s *server) Create(ctx context.Context, in *desc.CreateRequest) (*desc.Crea
return &desc.CreateResponse{Id: gofakeit.Int64()}, nil
}

// Delete удаляет чат по id
func (s *server) Delete(ctx context.Context, in *desc.DeleteRequest) (*emptypb.Empty, error) {
select {
case <-ctx.Done():
Expand All @@ -47,6 +49,7 @@ func (s *server) Delete(ctx context.Context, in *desc.DeleteRequest) (*emptypb.E
return &emptypb.Empty{}, nil
}

// SendMessage отправляет сообщение на сервер
func (s *server) SendMessage(ctx context.Context, in *desc.SendMessageRequest) (*emptypb.Empty, error) {
select {
case <-ctx.Done():
Expand Down

0 comments on commit 58a4c5f

Please sign in to comment.