Configuration

Night mode

Demo Models

A$AP Scalable Web Services with Go & Docker 🚀 Course

Engineers From These Top Companies and Universities Trust EXLskills

1M+ Professionals | 100+ Institutions

This is the EXLskills free and open-source A$AP Scalable Web Services with Go & Docker Course! It's a highly-accelerated open course that's best-suited for people with a bit of background in software engineering to quickly pick up Go, learn the essential best practices, and hit the ground running!
After this course, you'll be able to build lightweight, scalable, and idiomatic web services that connect to relational (SQL) databases, consider auth, and serve performant JSON REST APIs.
For further practice, we recommend checking out our Go Guided Projects that will give you access to a professional Go developer, detailed documentation, and real-world tasks that you can work on to go from the basics of Go, into building production apps.

Is this course FREE?

Yes, this a 100% free course that you can contribute to on GitHub here!

Have more questions?

Data Models

Demo Models

Representing Data in Go

The intermediary state between our database/datastore and output JSON (or HTML views, etc.) is going to be our data model structs in the models/ directory. We will also use this directory for specifying our request/response (frequently JSON) models, as well as the various DB-related models that we might need, i.e., model for the result of a JOIN query.

Gophers!

Since we're storing "gophers" in our MySQL database, let's create a model in models/gopher.go to represent that DB table:

User (virtual, for convenience)

Since frequently applications will have users, we'll add the boilerplate model in models/user.go since it is used in some of our middleware code, however, the DB table does not exist, so we will mock our DB methods.