job-board
job-board copied to clipboard
[DX] split handlers.go into domain specific handlers ie. company/handlers.go, job/handlers.go etc
related to #19 #12
I'm not sure about applying the split handler in your project. It will be a lifecycle import.
server.go
using company/repository.go
for do something ->So server.go
need to import internal/company
company/handler.go
using server.go
-> So company/handler.go
need to import internal/server
=>error lifecycle import
will appear if you want to change to structure project. Because of server.go
quite not good, server.go
uses another repository. But repo
and handler
inside 1 pkg
for structure:
internal\
company\
handler.go (import server pkg)
repository.go
server\
server.go (import company pkg)
===> error lifecycle import
I suggest you like this
internal\
handler\
company.go
developer.go
....
server\
server.go (import company pkg)
===> working
i think it's too much work to restructure all the folders, we could just add subfolders for each domain entity
/company
/handlers
handler.go
/repositories
repository.go
/models
model.go