blogserver

package
v0.0.0-...-08e93c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestMongoClient

func GetTestMongoClient() (*mongo.Client, error)

func NewTestBlog

func NewTestBlog() *api.Blog

Types

type Blog

type Blog struct {
	ID       primitive.ObjectID `bson:"_id,omitempty"`
	AuthorID string             `bson:"author_id"`
	Title    string             `bson:"title"`
	Content  string             `bson:"content"`
}

type BlogServer

type BlogServer struct {
	api.UnimplementedBloggerServer
	// contains filtered or unexported fields
}

func CreateTestBlogServer

func CreateTestBlogServer() (*BlogServer, func())

func NewBlogServer

func NewBlogServer(c *mongo.Collection) *BlogServer

func (*BlogServer) CreateBlog

func (b *BlogServer) CreateBlog(ctx context.Context, request *api.CreateBlogRequest) (*api.CreateBlogResponse, error)

func (*BlogServer) DeleteBlog

func (b *BlogServer) DeleteBlog(ctx context.Context, request *api.DeleteBlogRequest) (*api.DeleteBlogResponse, error)

func (*BlogServer) ListBlogs

func (b *BlogServer) ListBlogs(request *api.ListBlogRequest, server api.Blogger_ListBlogsServer) error

func (*BlogServer) ReadBlog

func (b *BlogServer) ReadBlog(ctx context.Context, request *api.ReadBlogRequest) (*api.ReadBlogResponse, error)

func (*BlogServer) UpdateBlog

func (b *BlogServer) UpdateBlog(ctx context.Context, request *api.UpdateBlogRequest) (*api.UpdateBlogResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL