Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(r *echo.Group, service Service)
RegisterHandlers for customer
Types ¶
type Message ¶
type Message interface {
Subscribe() error
}
func NewMessage ¶
func NewMessage(consumer mq.PushConsumer, repo Repository, rocketmq rocketmq.Provider, tracing tracing.Provider, logger logger.Provider) Message
type Repository ¶
type Repository interface { // OrderPaid needs to change order status, and probably notify other services, such as product service to // decrease the product sku. OrderPaid(ctx context.Context, orderID string) error CreateOrder(ctx context.Context, orderID string) error CreateOrderItem(ctx context.Context, orderID string) error }
Repository db repository
func NewRepository ¶
func NewRepository(pdb postgres.Provider) Repository
NewRepository returns a new repostory
type Service ¶
type Service interface { CreateFromCart(c context.Context, customerID int64, req createFromCartRequest) (id int64, err error) CreateFromProduct(c context.Context, customerID int64, req createFromProductRequest) (id int64, err 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.