Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(r *echo.Group, service Service)
RegisterHandlers for product
Types ¶
type Repository ¶
type Repository interface { // get product Get(ctx context.Context, id string) (prod product, err error) // create new product Create(ctx context.Context, req createRequest) (id string, err error) // update product Update(ctx context.Context, id string, req updateRequest) error // delete product Delete(ctx context.Context, id string) error }
Repository db repository
func NewRepository ¶
func NewRepository(mdb mongodb.Provider) Repository
NewRepository returns a new repostory
type Service ¶
type Service interface { Get(ctx context.Context, id string) (pro product, err error) // create new product Create(ctx context.Context, req createRequest) (id string, err error) // update product Update(ctx context.Context, id string, req updateRequest) error // delete product Delete(ctx context.Context, id string) error }
Service is cutomer service
func NewService ¶
func NewService(repo Repository, logger logger.Provider) Service
NewService is to create new service
Click to show internal directories.
Click to hide internal directories.