INNER CODE UNIT · Go
createMonolith
ThreeDotsLabs/monolith-microservice-shop · cmd/monolith/main.go:54
func createMonolith(ordersToPay chan payments_interfaces_intraprocess.OrderToProcess) (*chi.Mux, payments_interfaces_intraprocess.PaymentsInterface) {
shopProductRepo := shop_infra_product.NewMemoryRepository()
shopProductsService := shop_app.NewProductsService(shopProductRepo, shopProductRepo)
shopProductIntraprocessInterface := shop_interfaces_intraprocess.NewProductInterface(shopProductRepo)
ordersRepo := orders_infra_orders.NewMemoryRepository()
orderService := orders_app.NewOrdersService(
orders_infra_product.NewIntraprocessService(shopProductIntraprocessInterface),
orders_infra_payments.NewIntraprocessService(ordersToPay),
ordersRepo,
)
ordersIntraprocessInterface := orders_interfaces_intraprocess.NewOrdersInterface(orderService)
paymentsService := payments_app.NewPaymentsService(
payments_infra_orders.NewIntraprocessService(ordersIntraprocessInterface),
)
paymentsIntraprocessInterface := payments_interfaces_intraprocess.NewPaymentsInterface(ordersToPay, paymentsService)