service

package
v0.0.0-...-d11ffb8 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

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