mraow/proto/chat.proto

41 lines
857 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 {
2023-05-09 07:15:01 +00:00
string from = 1;
string msg = 2;
string time = 3;
2023-05-05 01:57:10 +00:00
}
2023-05-09 07:15:01 +00:00
message Channel {}
2023-05-08 20:14:24 +00:00
message UserList {}
2023-05-09 07:15:01 +00:00
message User { string username = 1; }
2023-05-08 20:14:24 +00:00
2023-05-09 07:15:01 +00:00
message JoinResponse {}
2023-05-08 20:14:24 +00:00
2023-05-09 07:15:01 +00:00
service Chat {
rpc join(User) returns (JoinResponse) {}
rpc sendMsg(ChatMessage) returns (google.protobuf.Empty) {}
rpc receiveMsg(google.protobuf.Empty) returns (stream ChatMessage) {}
rpc getAllUsers(google.protobuf.Empty) returns (UserList) {}
2023-05-08 20:14:24 +00:00
}
// Hello world shit
// The greeting service definition.
service Greeter {
// Sends a greeting
2023-05-09 07:15:01 +00:00
rpc SayHello(HelloRequest) returns (HelloReply) {}
2023-05-08 20:14:24 +00:00
}
// The request message containing the user's name.
2023-05-09 07:15:01 +00:00
message HelloRequest { string name = 1; }
2023-05-08 20:14:24 +00:00
// The response message containing the greetings
2023-05-09 07:15:01 +00:00
message HelloReply { string message = 1; }