TrB proto
Контракты сервисов и сгенерированный код:
- Go —
gen/go - JavaScript / TypeScript (protobuf + gRPC-Web) — npm-пакет
@marleena/trb-proto - Python (protobuf + gRPC) — PyPI-пакет
trb-proto
Генерация
Нужны protoc и плагины: protoc-gen-go, protoc-gen-go-grpc, protoc-gen-grpc-gateway, protoc-gen-js, protoc-gen-grpc-web.
make gene
Собирает Go, JS/TS и descriptor set. Google API-аннотации для JS генерируются отдельно, чтобы не попасть в gen/go.
Другие цели: make desc, make buf.
npm
npm install @marleena/trb-proto
import { MessageRequest } from '@marleena/trb-proto/example/Example_pb';
import { exampleClient } from '@marleena/trb-proto/example/ExampleServiceClientPb';
const client = new exampleClient('https://api.example.com');
const req = new MessageRequest();
req.setText('hello');
Python
pip install trb-proto
from indicators import indicators_pb2 as pb
from indicators import indicators_pb2_grpc
stub = indicators_pb2_grpc.IndicatorsStub(channel)
stub.ListSupported(pb.ListSupportedRequest())
Сервисы:
Внешние контракты в api/: api/tinvest.
Свои сервисы: clickhouse, nats, postgresql, test.
clickhouse — два proto: admin.proto (trb.clickhouse.v1.ClickHouse_Admin) и clickhouse.proto (trb.clickhouse.v1.ClickHouse).
postgresql — два proto: admin.proto (trb.postgresql.v1.PostgreSQL_Admin) и postgresql.proto (trb.postgresql.v1.PostgreSQL).
postgresql (trb.postgresql.v1.PostgreSQL) — цели планировщика: ListSchedulerTargets, SyncSchedulerTargets.
PostgreSQL_Admin — DDL, мониторинг и произвольные запросы: базы, схемы, таблицы, колонки, индексы, VACUUM/ANALYZE, процессы, блокировки.
nats (trb.nats.v1.Nats) — управление JetStream.
test (trb.test.v1.Test) — тестовый оркестратор.
CI/CD
Release на коммит v1.2.3 в main: npm (если версии ещё нет), PyPI trb-proto и POST /fetch/... на pkg.go.dev.
Trusted Publisher: npm — GitHub Mar1eena / TrB_proto / release.yml; PyPI — Pending publisher для trb-proto:
| Поле | Значение |
|---|---|
| PyPI project name | trb-proto |
| Owner | Mar1eena |
| Repository | TrB_proto |
| Workflow name | release.yml |
| Environment name | (оставить пустым) |
Pending publisher нужен до первого make rel, если проекта trb-proto на PyPI ещё нет.
Релиз
make rel
Собирает proto, поднимает patch-версию, коммитит все изменения с сообщением v1.2.3 и пушит в main. Actions публикует npm и обновляет pkg.go.dev.
Другой шаг версии: make rel PART=minor или PART=major.
Для коммита нужны user.name и user.email в Git.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trb_proto-1.0.37.tar.gz.
File metadata
- Download URL: trb_proto-1.0.37.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a4ec1bec11dae0dcb58703a3fc7b997f785ae4ed43ef9680738792873c8003
|
|
| MD5 |
4a1d45137e7dbccaa3013c362ed10a4b
|
|
| BLAKE2b-256 |
01c10e72726fe68e6cacd47556ea0c5b38bf54323f09bedb9762450449f92536
|
Provenance
The following attestation bundles were made for trb_proto-1.0.37.tar.gz:
Publisher:
release.yml on Mar1eena/TrB_proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trb_proto-1.0.37.tar.gz -
Subject digest:
59a4ec1bec11dae0dcb58703a3fc7b997f785ae4ed43ef9680738792873c8003 - Sigstore transparency entry: 2639590670
- Sigstore integration time:
-
Permalink:
Mar1eena/TrB_proto@f42f738c832c7b2efc30271180a0b1df7091deb5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mar1eena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f42f738c832c7b2efc30271180a0b1df7091deb5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trb_proto-1.0.37-py3-none-any.whl.
File metadata
- Download URL: trb_proto-1.0.37-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa1d58aecfc1e839c66fa9ade1cd49063f9d4cb4a58d063cfc28c5364bf23e19
|
|
| MD5 |
29036b0f04ff6a04b0e3d266e9947bd1
|
|
| BLAKE2b-256 |
f2bf57d67b34602bd8b8f59db817e355ddd3bfc730c994ef0f86ba9b9941e22d
|
Provenance
The following attestation bundles were made for trb_proto-1.0.37-py3-none-any.whl:
Publisher:
release.yml on Mar1eena/TrB_proto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trb_proto-1.0.37-py3-none-any.whl -
Subject digest:
fa1d58aecfc1e839c66fa9ade1cd49063f9d4cb4a58d063cfc28c5364bf23e19 - Sigstore transparency entry: 2639591671
- Sigstore integration time:
-
Permalink:
Mar1eena/TrB_proto@f42f738c832c7b2efc30271180a0b1df7091deb5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Mar1eena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f42f738c832c7b2efc30271180a0b1df7091deb5 -
Trigger Event:
push
-
Statement type: