Skip to content

Instantly share code, notes, and snippets.

@manakuro
Last active February 10, 2023 08:43
Show Gist options
  • Save manakuro/36ddbafe3336f95c0a2ed654ad0c8a82 to your computer and use it in GitHub Desktop.
Save manakuro/36ddbafe3336f95c0a2ed654ad0c8a82 to your computer and use it in GitHub Desktop.
package registry
import (
"golang-clean-architecture/interface/controller"
ip "golang-clean-architecture/interface/presenter"
ir "golang-clean-architecture/interface/repository"
"golang-clean-architecture/usecase/interactor"
)
func (r *registry) NewUserController() controller.UserController {
userInteractor := interactor.NewUserInteractor(
ir.NewUserRepository(r.db),
ip.NewUserPresenter(),
ir.NewDBRepository(r.db),
)
return controller.NewUserController(userInteractor)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment