update blog/posts and go mod

This commit is contained in:
Asim Aslam
2021-01-27 14:47:22 +00:00
parent fc7c6e0870
commit 87348d1908
8 changed files with 545 additions and 742 deletions

View File

@@ -39,3 +39,17 @@ func (e *Blog) Latest(ctx context.Context, req *proto.LatestRequest, rsp *proto.
return nil
}
func (e *Blog) Posts(ctx context.Context, req *proto.PostsRequest, rsp *proto.PostsResponse) error {
resp, err := e.ps.Query(ctx, &posts.QueryRequest{
Limit: req.Limit,
Offset: req.Offset,
})
if err != nil {
return err
}
rsp.Posts = resp.Posts
return nil
}