Reputation: 1121
I just started learning/using Golang, and want to develop a restful API (starting with this great video tutorial).
Do we have a best practice for the project structure for Golang projects? (such as dropwizard's suggested project structure for java)
for example should I put the model (API request/response) in a separate directory? what is the suggested naming for API calls (equivalent to resources
in dropwizard)? etc.
any suggestions/reference is appreciated
Upvotes: 2
Views: 5641
Reputation: 3318
A good structure for web applications I use is the following:
└───app
├───config
├───controllers
└───models
I think its pretty straightforward to understand
Upvotes: -3
Reputation: 5226
For rest-api
i use something like below,
.
├───app
│ ├───handlers
│ |───models
| └───app.go
|───config
└───main.go
Where,
Upvotes: 3