CRUD examples in Go for SaaS Web App
Example List Objects template code in Go Web App
The projects functionality in the Go web app provides example functionality on how CRUD can be performed and exposed. The web app includes this index page that lists all records. This index page then allows users to view, update and delete an object.
Example Create Object template code in Go Web App
From the projects index page, users can click the button to create a new record. This create page demonstrates how a new record can be created for projects and also demonstrates inline validation.
Example Read Object template code in Go Web App
The view page for an object displays the fields for the object as read-only. The page then includes links to edit or archive the object. The archive functionality demonstrates how a soft-delete can be performed. While the web app does not expose functionality to delete a record, the internal API does support the delete operation.
Example Update Object template code in Go Web App
This update page demonstrates how a record can be edited. The various fields that you want to allow users to change can be exposed. The changes can then be saved to update the record.
Example Datatable implementation in Go Web App
The Go web app for SaaS uses Datatables to provide interactivity when listing objects. Datatables provides a free and easy way to add advanced interaction controls to your HTML tables. These Datatables in the Go web app are rendered server-side. The Golang code to render a data table has been abstracted into it a partial template.
This shows how users can interact with a Datatable in your Go web app by searching the records listed.
Example Inline Validation code for validating CRUD in Go Web App
The manage projects functionality in the Go Web App implements server-side validation. A flash message is rendered to display the error message. Errors for specific fields are removed from the flash message and instead included with the specific field inline.
Provide Feedback via our Google Slides
If you would like to provide us feedback on any of these screen captures and associated functionality, you are welcome to publicly comment on our Google Slides: