Build A Restful Api With Golang Go Programming Language

Golang: Intro to REST APIs with Golang (Go programming language) & 1.5hr of React-Redux bonus content (frontend)

Last updated 2022-01-10 | 4.2

- Create a model from Golang's struct type and a slice to add records to
- Create a router and register to it api endpoints and handler functions
- Build handler functions to do CRUD operations

What you'll learn

Create a model from Golang's struct type and a slice to add records to
Create a router and register to it api endpoints and handler functions
Build handler functions to do CRUD operations
Create a Postgres database instance and a table to save records
Establish a connection to the database and query the table for records as well as insert
update and delete individual records
Build the handler functions to make queries to the database and perform CRUD operations on persistent data
Make use of packages such as gorilla/mux
strconv
reflect and etc

* Requirements

* Beginner level Golang (Go programming language) knowledge (variable declaration
* structs and slices)
* The Go distribution
* Any text editor (I use atom)

Description

Welcome to Build RESTful APIs with Golang (Go programming language) course. This create RESTful APIs with Golang (Go programming language) is a short no nonsense course packed with useful information that you can complete within a weekend or a few of evenings after work.

Whether you are a backend or front end developer, if you are looking for a quick, straight forward and step by step introduction to how to build RESTful APIs with Golang (Go programming language) this is the course for you. 

Build RESTful APIs with Golang (Go programming language) is a collection of successive, quick and to the point hands on lectures that put emphasis on doing (code along) rather than just talking and showing slides. It is only 2 hours so it won't be another one of those 10 hours courses that you buy and end up not completing.

What will you build?

You will create RESTful APIs with Golang (Go) that will perform CRUD operations or CREATE, READ, UPDATE AND DELETE on data you save on a PostgreSQL database.

You will work with structs and slices to create your model and store and pass data around. You will create a router to register your api endpoints and handler functions. You will also learn how to refactor your code and create a modular file structure.

You will make use of technologies such as the PostgreSQL database for persisting records, Postman for making API requests, and third party packages such as  gorilla/mux for routing, and other packages for loading environment variables, making http requests, encoding and decoding JSON, performing string conversions and checking types.

Both Go (Golang) programming language has become very popular among startups and the development community in general. Golang is a great language designed with simplicity, maintainability and performance in mind.  Now is the best time to learn both Go.

Who this course is for:

  • Beginner level Golang (Go programming language) developers

Course content

8 sections • 53 lectures

Introduction Preview 00:54

Setting up your environment Preview 02:55

Lecture 3: A few points on what to expect Preview 01:45

Join the student group Preview 00:15

Introduction to REST Preview 12:29

Create the Book model and books slice Preview 01:17

Install third party packages Preview 01:32

Create the router and register api-endpoints and handler Preview 08:04

Add static data and implement 'getBooks' Preview 02:11

Implement 'getBook' handler to get a single book Preview 08:16

Implement 'addBook' and use Postman for http requests Preview 07:34

Implement 'updateBook' Preview 04:51

Implement 'removeBook' Preview 03:48

Create a Postgres database-instance and table Preview 05:41

Refactor code to include database interaction Preview 04:29

Set and load environment variables Preview 04:21

Connect to the database instance Preview 03:43

Implement 'getBooks' to get all book records from the table Preview 04:36

Implement 'getBook' to get a book record from the table by its id Preview 02:58

Implement 'addBook' to add a book record to the table Preview 07:48

Implement 'updateBook' to update a book record on the table Preview 06:05

Implement 'removeBook' to remove a book record from the table by its id Preview 04:42

Go modules Preview 03:43

Apply Go Modules

Create book and error models Preview 04:09

Refactor driver and book model Preview 03:03

Create utils methods Preview 03:27

Create Getbooks Controller method Preview 05:33

Create GetBooks Repository method Preview 08:25

Refactor the GetBook handler Preview 05:07

Refactor addBook, updateBook and removeBook handlers Preview 06:12

Add CORS config Preview 00:04

1 - Create react app and install packages Preview 03:13

2 - Create folders data & books container Preview 05:20

3 - Create Book component Preview 03:23

4 - Implement Book component Preview 03:13

5 - Create routes Preview 02:56

6 Implement the Nav component Preview 03:28

7 Create types, actions & reducers Preview 04:21

8 Implement fetchAllBooks Preview 03:41

9 - Connect to server Preview 02:28

10 - Render data and show loading state Preview 06:27

11 - Render server error message Preview 05:26

12 Connect createBook to redux Preview 05:57

13 Implement createBook action creator Preview 08:23

14 - Move fetchBooks from index to book component Preview 01:24

15 - Implement createBookError Preview 02:46

16 - Implement cancel action Preview 02:09

17 Implement edit action Preview 10:23

18 Implement editBook reducer Preview 04:46

19 Implement delete action Preview 06:31

Bonus: Build a React-Redux client for the CRUD APIs you have implemented above Preview 00:11

REST authentication course Preview 00:07