l-ai-chat-proto/README.md

25 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# l-ai-chat-proto
Protobuf-контракты Live Chat (`l-ai-chat`). Репозиторий хранит и `.proto`, и сгенерированный Go-код (как остальные proto-модули проекта).
## Содержимое
- `chat.proto` — единый контракт `ChatService` (topics list/get/create/update, post/get/history, subscribe, acknowledge) + `Message`/`Topic` + enums `AuthorType`/`MessageSource`.
- `chat.pb.go`, `chat_grpc.pb.go` — сгенерированный код, закоммичен.
## Регенерация
Нужны `protoc` + `protoc-gen-go` + `protoc-gen-go-grpc` в PATH:
```bat
generate_proto.bat
```
Сгенерированный код коммитится в этот репозиторий; сервисы подключают его как git submodule (см. `l-ai-chat/proto/l-ai-chat-proto`).
## Соглашения
- `package chat`, `option go_package = "git.be.kaien.ru/l-ai/l-ai-chat-proto/proto"`.
- Enum-значения префиксованы (`AUTHOR_TYPE_*`, `MESSAGE_SOURCE_*`) — избегаем C++-scoping коллизий.
- История пагинируется по `sequence` (`before_sequence`/`after_sequence`), offset-пагинации нет.