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

How to use a different routing library? #17

Closed alok87 closed 5 years ago

alok87 commented 5 years ago

If I want to replace labstack/echo in this implementation with https://github.com/go-chi/chi Where to put the code and make the change? Don't see any interface around delivery and middlewares.

bxcodec commented 5 years ago

Hi @alok87, For my case, I will only change the delivery layer, if it too different with echo, well, it doesn't matter to change the implemetation of the entire of delivery layer, because it's just will change the delivery layer, not the entire projects.

Currently, I don't see any important reasons to use the interface here, but if you have some ideas, I'll listen to it?

alok87 commented 5 years ago

Good to have interfaces around the routing library as when the project would require a new routing library we can just write a new implementation for the new routing library and use it. No?

bxcodec commented 5 years ago

I'm afraid to say No. Usually, people use framework for the HTTP handler to ease the routing things. And we can't treat every framework same, some framework can be used with struct, some don't. So I'll keep it just as is, to keep it flexible :D