Creating Web Applications with Go

This course takes users with a basic understanding of the Go language, and deepens that knowledge by working through the creation of a full-featured web application that implements the model, view, controller (MVC) design pattern.
Course info
Rating
(162)
Level
Intermediate
Updated
Apr 21, 2015
Duration
3h 58m
Table of contents
Introduction
Creating a Resource Server
HTML Templates
MVC: The View Layer
MVC: The Controller Layer - Part 1
MVC: The Controller Layer – Part 2
MVC: The Model Layer
Persisting Data
Description
Course info
Rating
(162)
Level
Intermediate
Updated
Apr 21, 2015
Duration
3h 58m
Description

This course introduces the Go language as a tool for solving practical problems; in this case, creating a web-application. It assumes that the user has a basic understanding of the language, but not much more. Over the span of the course, aspects of a complete web application are built with an eye on practical application of the language. Additionally, the course will be focused on the core Go libraries, as opposed to plug-ins. To that end, only two plugins are necessary: one to provide parameterized routes (a basic requirement for modern web applications), and a database driver to provide connectivity to a database (none of which are bundled in the Go core library.)

About the author
About the author

Michael Van Sickle is an application architect in Akron, Ohio. He is a mechanical engineer by training and a software engineer by choice. He is passionate about learning new programming languages and user experience design.

More from the author
The Go CLI Playbook
Intermediate
2h 8m
28 Feb 2018
Intern 4: Getting Started
Beginner
2h 41m
9 Jan 2018
Object-oriented Programming with Go
Intermediate
1h 42m
11 Aug 2017
More courses by Mike Van Sickle
Section Introduction Transcripts
Section Introduction Transcripts

Introduction
Hi, this is Michael Van Sickle for Pluralsight. Welcome to this course where we are going to learn how to create web applications using Google's Go language. While certainly not the only thing that Go can be used for, creating a web application is going to give us a great opportunity to explore this language and learn a lot about how it can be used to create applications.

Creating a Resource Server
Hi. My name is Michael Van Sickle for Pluralsight. Welcome back to this course where we are using Google's Go language to build a web application. In the last module, we learned a little bit about Go and got our environment set up. Now it is time to take our first steps into the world of web applications by creating a simple resource server that will allow us to use Go to download files with a web browser. Along the way, we'll learn about a couple of different ways that Go allows us to handle an HTTP request, as well as exploring why using buffered output is important to use when creating applications like this.

HTML Templates
Hi. This is Michael Van Sickle for Pluralsight. Welcome back to this course where we are learning how to use Go to create web applications. In the last module we learned how to use functions from the net/http library to create objects and functions that listened for HTTP requests. In this module we are going to build on that knowledge and learn how Go's templating library can be used to allow us to combine templates with data to allow content to be dynamically generated.

MVC: The View Layer
Hello. This is Michael Van Sickle for Pluralsight. Welcome back to this course where we are learning how to create web applications with Go. The last two modules have introduced some of the basic building blocks of web applications by introducing how to handle HTTP messages and how to create data-driven HTML pages. While this is all good information, my goal in this course isn't to teach theory alone. I want to show you how you can use this powerful language to build out a full application. Now that we've covered the basics, let's get started for real.

MVC: The Controller Layer - Part 1
Hello. This is Michael Van Sickle for Pluralsight. Welcome back to this course where we are learning how to build web applications with Go. In the last module, we converted the static HTML pages that made up our application into data-driven templates that increased the flexibility and reusability of our pages. It also set us up to be able to dynamically adjust the pages that we showed to the user by injecting data that is stored in our application's database. In this module, we are going to start the process of introducing the controller layer for our custom model-view-controller framework. This layer is going to allow us to receive our user request and route it through the application, eventually feeding data into the view layer to be bound by the templates and therefore generating the resulting web pages. Along the way, we'll show a way to use the controller layer to introduce additional functionality typically known as middleware. While we aren't going to be doing anything approaching a robust solution for that, I'll show you how it can be done by introducing gzip compression into our controllers allowing us to optimize the amount of data sent over the wire if the client supports it. Like a lot of things that I'm going to show you throughout this course, you can find very good solutions for middleware provided by third-party libraries, so I'm not going to try and compete with them. The goal of showing you this is to help you understand how you can create one by yourself should the need arise.

MVC: The Controller Layer – Part 2
Welcome back to this course where we're exploring Google's Go language. We've been doing that by building a web application with a complete model, view, controller design. In order to focus on the language itself, we have limited our use of third-party libraries as much as we can. In the last module, we started to build the controller layer of our application. We learned how to use front and back controllers in order to keep the routing of our application separate from how those routes are handled. We also learned about how to use parameterized routes to provide a convenient way to reuse application logic to handle different resources that are of the same type, such as the different types of juices that are offered in our lemonade supply store. Finally, we wrapped up by adding the ability of our application to detect if the client can process responses that had been encoded using the gzip compression algorithm. If it could, we took advantage of that fact to deliver the response using this more efficient delivery mechanism. In this module, we are going to explore a few ways that Go can receive information from the client and use that to generate a response. We'll cover the two major methods that are used to accomplish this in modern web application design. First, we'll work with an HTML form element and learn how to access the data that is passed in the form's fields. Second, we'll set up a simple asynchronous request using AJAX and JavaScript to make a request to the server. This will allow us to adjust the user experience without requiring them to navigate to another page.