Fyne lets you generate a sample Golang application from a given JSON schema including models, handlers, db and routes.
npm install -g fyne
Test your installation
fyne --version
- Create a schema file ie. schema.json for model Payment
{
"name": "string",
"amount": "int64",
"paidAt": "time.Time"
}
- Run
fyne template Payment schema.json
- Voila!
- ID, CreateDate, UpdateDate are added to the models by default
- Use
go mod init {{module name}}
and add an entry point to run the API server