48 lines
939 B
Protocol Buffer
48 lines
939 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = ".;proto";
|
|
|
|
package proto;
|
|
|
|
service StreamService {
|
|
rpc CountStreamConnection(CountConnectionRequest) returns (CountConnectionResponse) {}
|
|
rpc PushStream(PushStreamRequest) returns (PushStreamResponse) {}
|
|
rpc PushStreamBatch(PushStreamBatchRequest) returns (PushStreamResponse) {}
|
|
}
|
|
|
|
message CountConnectionRequest {
|
|
uint64 user_id = 1;
|
|
}
|
|
|
|
message CountConnectionResponse {
|
|
int64 count = 1;
|
|
}
|
|
|
|
message PushStreamRequest {
|
|
optional uint64 user_id = 1;
|
|
optional uint64 client_id = 2;
|
|
bytes body = 3;
|
|
}
|
|
|
|
message PushStreamBatchRequest {
|
|
repeated uint64 user_id = 1;
|
|
repeated uint64 client_id = 2;
|
|
bytes body = 3;
|
|
}
|
|
|
|
message PushStreamResponse {
|
|
bool is_all_success = 1;
|
|
int64 affected_count = 2;
|
|
int64 failed_count = 3;
|
|
}
|
|
|
|
message StreamEventRequest {
|
|
string event = 1;
|
|
uint64 user_id = 2;
|
|
uint64 client_id = 3;
|
|
bytes payload = 4;
|
|
}
|
|
|
|
message StreamEventResponse {
|
|
}
|