mraow/proto/chat.proto

45 lines
843 B
Protocol Buffer
Raw Normal View History

2023-05-05 01:57:10 +00:00
syntax = "proto3";
2023-05-08 20:14:24 +00:00
package chat;
import "google/protobuf/empty.proto";
2023-05-05 01:57:10 +00:00
message ChatMessage {
string from = 1;
string msg = 2;
string time = 3;
}
2023-05-08 20:14:24 +00:00
message UserList {}
message User {
}
message JoinResponse {
}
2023-05-05 01:57:10 +00:00
service ChatService {
rpc join(User) returns (JoinResponse) {}
2023-05-08 20:14:24 +00:00
rpc sendMsg(ChatMessage) returns (google.protobuf.Empty) {}
rpc receiveMsg(google.protobuf.Empty) returns (stream ChatMessage) {}
rpc getAllUsers(google.protobuf.Empty) returns (UserList) {}
}
// Hello world shit
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}