bxcodec / go-clean-arch

Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture
MIT License
9.06k stars 1.19k forks source link

V2 #8

Closed bxcodec closed 6 years ago

bxcodec commented 6 years ago

Proposed Changes:

Close #7

bxcodec commented 6 years ago

There will be a new packages called: models

models
├── article.go
├── author.go
└── errors.go

This package models, will store any models used in entire projects

Domain Package

And for each domain, will have the other layer like : repository, usecase and delivery. And moving the interface to the root of domain. This how it looks now:

Article Domain

article
├── delivery
│   └── http
│       ├── article_handler.go
│       └── article_test.go
├── mocks
│   ├── ArticleRepository.go
│   └── ArticleUsecase.go
├── repository //Encapsulated Implementation of Repository Interface
│   ├── mysql_article.go
│   └── mysqlarticle_test.go
├── repository.go // Repository Interface
├── usecase //Encapsulated Implementation of Usecase Interface
│   ├── articleucase_test.go
│   └── artilce_ucase.go
└── usecase.go // Usecase Interface.

My reason making this structure are:

For some people this arch, will not solve their problem, so make sure to search others do, that may be fit to your problem.