Autoplay
Autocomplete
Previous Lesson
Complete and Continue
Golang: Build REST APIs with Golang (Go programming lang)
Introduction
Introduction (0:54)
What to expect (1:45)
Setup (2:55)
REST, creating the model and registering the routes
Introduction to REST (12:29)
Create the Book model and books slice (1:17)
Install third party packages (1:32)
Create the router and register endpoints (8:04)
Implementing CRUD apis with data in memory
Add static data and implement 'getBooks' (2:11)
Implement 'getBook' handler to get a single book (8:16)
Implement 'addBook' and use Postman for http requests (7:34)
Implement 'updateBook' (4:51)
Implement 'removeBook' (3:48)
Persisting the data
Create a Postgres database-instance and table (5:41)
Set and load environment variables (4:21)
Connect to the database instance (3:43)
Implement 'getBooks' to get all book records from the table (4:36)
Implement 'getBook' to get a book record from the table by its id (2:58)
Implement 'addBook' to add a book record to the table (7:48)
Implement 'updateBook' to update a book record on the table (6:05)
Implement 'removeBook' to remove a book record from the table by its id (4:42)
Refactor
Go modules (3:43)
Create book and error models (4:09)
Refactor driver and book model (6:30)
Create utils methods
Create Getbooks Controller method (5:33)
Create GetBooks Repository method (8:25)
Refactor the GetBook handler (5:07)
Refactor addBook, updateBook and removeBook handlers (6:11)
Source code
Source code
Teach online with
Implement 'removeBook' to remove a book record from the table by its id
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock