add Posts.Index

This commit is contained in:
Asim Aslam
2021-02-02 12:58:17 +00:00
parent fc61b45ee4
commit c19bf17fb5
4 changed files with 190 additions and 36 deletions

View File

@@ -3,6 +3,8 @@ syntax = "proto3";
package posts;
service Posts {
// Index returns the posts index without content
rpc Index(IndexRequest) returns (IndexResponse) {}
// Query currently only supports read by slug or timestamp, no listing.
rpc Query(QueryRequest) returns (QueryResponse) {}
rpc Save(SaveRequest) returns (SaveResponse) {}
@@ -22,6 +24,15 @@ message Post {
string image = 19;
}
message IndexRequest {
int64 limit = 1;
int64 offset = 2;
}
message IndexResponse {
repeated Post posts = 1;
}
// Query posts. Acts as a listing when no id or slug provided.
// Gets a single post by id or slug if any of them provided.
message QueryRequest {