Skip to content

Commit

Permalink
add base rpc types
Browse files Browse the repository at this point in the history
  • Loading branch information
d-roak committed Sep 23, 2024
1 parent d2a3a8d commit ab67353
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 20 deletions.
7 changes: 2 additions & 5 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
version: v2
managed:
enabled: true
plugins:
- local: ./node_modules/ts-proto/protoc-gen-ts_proto
strategy: directory
out: ./packages
opt:
- esModuleInterop=true
- fileSuffix=_pb
inputs:
- directory: ./packages
exclude_paths:
- packages/network/node_modules
- packages/object/node_modules
2 changes: 2 additions & 0 deletions buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by buf. DO NOT EDIT.
version: v2
14 changes: 14 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: v2
modules:
- path: packages
- includes:
- packages/network
- packages/object
- excludes:
- node_modules
- packages/network/node_modules
- packages/object/node_modules
- examples/canvas/node_modules
- examples/chat/node_modules
deps:
- buf.build/googleapis/googleapis
1 change: 1 addition & 0 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@topology-foundation/network": "0.2.0",
"@topology-foundation/object": "0.2.0",
"commander": "^12.1.0",
"google-protobuf": "^3.21.2",
"it-length-prefixed": "^9.1.0"
}
}
43 changes: 43 additions & 0 deletions packages/node/src/proto/rpc.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
syntax = "proto3";
package topology.rpc;
import "google/api/http.proto";
import "google/api/annotations.proto";

service Rpc {
rpc subscribeCro (SubscribeCroRequest ) returns (SubscribeCroResponse ) {
option (google.api.http).get = "/topopology/cro/subscribe/{cro_id}";
};
rpc unsubscribeCro (UnsubscribeCroRequest ) returns (UnsubscribeCroRequest ) {
option (google.api.http).get = "/topopology/cro/subscribe/{cro_id}";
};
rpc getCroHashGraph (GetCroHashGraphRequest ) returns (GetCroHashGraphResponse ) {
option (google.api.http).get = "/topopology/cro/subscribe/{cro_id}";
};
}

message SubscribeCroRequest {
string cro_id = 1;
}

message SubscribeCroResponse {
// can return error codes if different than 0
int return_code = 1;
}

message UnsubscribeCroRequest {
string cro_id = 1;
}

message UnsubscribeCroResponse {
// can return error codes if different than 0
int return_code = 1;
}

message getCroHashGraphRequest {
string cro_id = 1;
}

message getCroHashGraphResponse {
// linearized vertices hashes
repeated string vertices_hashes = 1;
}
38 changes: 23 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab67353

Please sign in to comment.