Documentation ¶
Index ¶
- type Item
- type Server
- func (s Server) CreateBlog(ctx context.Context, req *blogpb.CreateBlogRequest) (*blogpb.CreateBlogResponse, error)
- func (s Server) DeleteBlog(ctx context.Context, req *blogpb.DeleteBlogRequest) (*blogpb.DeleteBlogResponse, error)
- func (s Server) ListBlog(req *blogpb.ListBlogRequest, stream blogpb.BlogService_ListBlogServer) error
- func (s Server) ReadBlog(ctx context.Context, req *blogpb.ReadBlogRequest) (*blogpb.ReadBlogResponse, error)
- func (s Server) UpdateBlog(ctx context.Context, req *blogpb.UpdateBlogRequest) (*blogpb.UpdateBlogResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { ID primitive.ObjectID `bson:"_d, omitempty"` AuthorID string `bson:"author_id"` Content string `bson:"content"` Title string `bson:"title"` }
Item is an itemized blog post
type Server ¶
type Server struct {
Collection *mongo.Collection
}
Server is an implementation of the Blog RPC proto
func (Server) CreateBlog ¶
func (s Server) CreateBlog(ctx context.Context, req *blogpb.CreateBlogRequest) (*blogpb.CreateBlogResponse, error)
CreateBlog creates a blog entry
func (Server) DeleteBlog ¶
func (s Server) DeleteBlog(ctx context.Context, req *blogpb.DeleteBlogRequest) (*blogpb.DeleteBlogResponse, error)
DeleteBlog deletes a blog by blog_id
func (Server) ListBlog ¶
func (s Server) ListBlog(req *blogpb.ListBlogRequest, stream blogpb.BlogService_ListBlogServer) error
ListBlog lists all blog posts
func (Server) ReadBlog ¶
func (s Server) ReadBlog(ctx context.Context, req *blogpb.ReadBlogRequest) (*blogpb.ReadBlogResponse, error)
ReadBlog takes in a blog id, and returns a Blog
func (Server) UpdateBlog ¶
func (s Server) UpdateBlog(ctx context.Context, req *blogpb.UpdateBlogRequest) (*blogpb.UpdateBlogResponse, error)
UpdateBlog updates a blog post
Click to show internal directories.
Click to hide internal directories.