Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID string `json:"id,omitempty" bson:"id"` UserID string `json:"user_id,omitempty" bson:"user_id"` PostID string `json:"post_id,omitempty" bson:"post_id"` Title string `json:"title,omitempty" bson:"title"` Body string `json:"body,omitempty" bson:"body"` }
Comment struct
type CommentsService ¶
type CommentsService interface { // Add your methods here Store(ctx context.Context, cm Comment) (id string, err error) Update(ctx context.Context, cm Comment) (id string, err error) List(ctx context.Context, postID string) (cms []*pb.Comment, err error) }
CommentsService describes the service.
func New ¶
func New(middleware []Middleware) CommentsService
New returns a CommentsService with all of the expected middleware wired in.
func NewBasicCommentsService ¶
func NewBasicCommentsService() CommentsService
NewBasicCommentsService returns a naive, stateless implementation of CommentsService.
type Middleware ¶
type Middleware func(CommentsService) CommentsService
Middleware describes a service middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
LoggingMiddleware takes a logger as a dependency and returns a CommentsService Middleware.
Click to show internal directories.
Click to hide internal directories.