Skip to content

Instantly share code, notes, and snippets.

@shmurakami
Created August 14, 2020 12:33
Show Gist options
  • Save shmurakami/954681fd69a87d236bbc99b257376cb3 to your computer and use it in GitHub Desktop.
Save shmurakami/954681fd69a87d236bbc99b257376cb3 to your computer and use it in GitHub Desktop.
example ToDo service proto
syntax = "proto3";
option java_package = "com.example.todo";
service TodoService {
rpc list (TodoListRequest) returns (TodoListReply);
rpc get (TodoRequest) returns (TodoReply);
rpc create (TodoCreateRequest) returns (TodoCreateReply);
rpc update (TodoUpdateRequest) returns (TodoUpdateReply);
rpc done (TodoDoneRequest) returns (TodoDoneReply);
rpc delete (TodoDeleteRequest) returns (TodoDeleteReply);
}
message TodoListRequest {
}
message TodoListReply {
repeated TodoReply list = 1;
}
message TodoRequest {
uint32 id = 1;
}
message TodoReply {
uint32 id = 1;
string todo = 2;
string due_date = 3;
bool done = 4;
}
message TodoCreateRequest {
string todo = 1;
string due_date = 2;
}
message TodoCreateReply {
uint32 id = 1;
}
message TodoDoneRequest {
uint32 id = 1;
bool done = 2;
}
message TodoDoneReply {
bool success = 1;
}
message TodoUpdateRequest {
uint32 id = 1;
string todo = 2;
string due_date = 3;
}
message TodoUpdateReply {
bool success = 1;
}
message TodoDeleteRequest {
uint32 id = 1;
}
message TodoDeleteReply {
bool success = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment