2024-07-14 15:45:18 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
option go_package = ".;proto";
|
|
|
|
|
|
|
|
package proto;
|
|
|
|
|
|
|
|
service StreamController {
|
2024-07-14 15:49:34 +00:00
|
|
|
rpc CountStreamConnection(CountConnectionRequest) returns (CountConnectionResponse) {}
|
2024-07-14 15:45:18 +00:00
|
|
|
rpc PushStream(PushStreamRequest) returns (PushStreamResponse) {}
|
2024-07-17 03:58:51 +00:00
|
|
|
rpc PushStreamBatch(PushStreamBatchRequest) returns (PushStreamResponse) {}
|
2024-07-20 11:47:04 +00:00
|
|
|
rpc EmitStreamEvent(StreamEventRequest) returns (StreamEventResponse) {}
|
2024-07-14 15:45:18 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 15:49:34 +00:00
|
|
|
message CountConnectionRequest {
|
|
|
|
uint64 user_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CountConnectionResponse {
|
|
|
|
int64 count = 1;
|
|
|
|
}
|
|
|
|
|
2024-07-14 15:45:18 +00:00
|
|
|
message PushStreamRequest {
|
2024-08-23 11:08:07 +00:00
|
|
|
optional uint64 user_id = 1;
|
|
|
|
optional uint64 client_id = 2;
|
|
|
|
bytes body = 3;
|
2024-07-14 15:45:18 +00:00
|
|
|
}
|
|
|
|
|
2024-07-17 03:58:51 +00:00
|
|
|
message PushStreamBatchRequest {
|
|
|
|
repeated uint64 user_id = 1;
|
2024-08-23 11:08:07 +00:00
|
|
|
repeated uint64 client_id = 2;
|
|
|
|
bytes body = 3;
|
2024-07-17 03:58:51 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 15:45:18 +00:00
|
|
|
message PushStreamResponse {
|
|
|
|
bool is_all_success = 1;
|
|
|
|
int64 affected_count = 2;
|
|
|
|
int64 failed_count = 3;
|
2024-07-17 03:58:51 +00:00
|
|
|
}
|
2024-07-20 11:47:04 +00:00
|
|
|
|
|
|
|
message StreamEventRequest {
|
|
|
|
string event = 1;
|
|
|
|
uint64 user_id = 2;
|
2024-08-23 11:08:07 +00:00
|
|
|
uint64 client_id = 3;
|
|
|
|
bytes payload = 4;
|
2024-07-20 11:47:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message StreamEventResponse {
|
|
|
|
}
|