▶Book Description
Go is the language of the Internet age, and the latest version of Go comes with major architectural changes. Implementation of the language, runtime, and libraries has changed significantly. The compiler and runtime are now written entirely in Go. The garbage collector is now concurrent and provides dramatically lower pause times by running in parallel with other Go routines when possible.
This book will show you how to leverage all the latest features and much more. This book shows you how to build powerful systems and drops you into real-world situations. You will learn to develop high-quality command-line tools that utilize the powerful shell capabilities and perform well using Go's in-built concurrency mechanisms. Scale, performance, and high availability lie at the heart of our projects, and the lessons learned throughout this book will arm you with everything you need to build world-class solutions. You will get a feel for app deployment using Docker and Google App Engine. Each project could form the basis of a start-up, which means they are directly applicable to modern software markets.
▶What You Will Learn
⦁ Build quirky and fun projects from scratch while exploring patterns, practices, and techniques, as well as a range of different technologies
⦁ Create websites and data services capable of massive scale using Go's net/http package, exploring RESTful patterns as well as low-latency WebSocket APIs
⦁ Interact with a variety of remote web services to consume capabilities ranging from authentication and authorization to a fully functioning thesaurus
⦁ Develop high-quality command-line tools that utilize the powerful shell capabilities and perform well using Go's in-built concurrency mechanisms
⦁ Build microservices for larger organizations using the Go Kit library
⦁ Implement a modern document database as well as high-throughput messaging queue technology to put together an architecture that is truly ready to scale
⦁ Write concurrent programs and gracefully manage the execution of them and communication by smartly using channels
⦁ Get a feel for app deployment using Docker and Google App Engine
▶Key Features
⦁ Get up to date with Go and write code capable of delivering massive world-class scale performance and availability
⦁ Learn to apply the nuances of the Go language, and get to know the open source community that surrounds it to implement a wide range of start-up quality projects
⦁ Write interesting and clever but simple code, and learn skills and techniques that are directly transferrable to your own projects
▶Who This Book Is For
If you are familiar with Go and are want to put your knowledge to work, then this is the book for you. Go programming knowledge is a must.
▶Style and approach
This book provides fun projects that involve building applications from scratch. These projects will teach you to build chat applications, a distributed system, and a recommendation system.
▶What this book covers
⦁ Chapter 1, Chat Application with Web Sockets, shows how to build a complete web application that allows multiple people to have a real-time conversation right in their web browser. We will see how the NET/HTTP package let us serve HTML pages as well as connect to the client's browser with web sockets.
⦁ Chapter 2, Adding User Accounts, shows how to add OAuth to our chat application so that we can keep track of who is saying what, but let them log in using Google, Facebook, or GitHub.
⦁ Chapter 3, Three Ways to Implement Profile Pictures, explains how to add profile pictures to the chat application taken from either the authentication service, the Gravitar.com web service, or by allowing users to upload their own picture from their hard drive.
⦁ Chapter 4, Command-Line Tools to Find Domain Names, explores how easy building command-line tools is in Go and puts those skills to use to tackle the problem of finding the perfect domain name for our chat application. It also explores how easy Go makes it to utilize the standard-in and standard-out pipes to produce some pretty powerful composable tools.
⦁ Chapter 5, Building Distributed Systems and Working with Flexible Data, explains how to prepare for the future of democracy by building a highly-scalable Twitter polling and vote counting engine powered by NSQ and MongoDB.
⦁ Chapter 6, Exposing Data and Functionality through a RESTful Data Web Service API, looks at how to expose the capabilities we built in Chapter 5, Building Distributed Systems and Working with Flexible Data, through a JSON web service, specifically how the wrapping http.HandlerFunc functions give us a powerful pipeline pattern.
⦁ Chapter 7, Random Recommendations Web Service, shows how to consume the Google Places API to generate a location-based random recommendations API that represents a fun way to explore any area. It also explores why it's important to keep internal data structures
private, controlling the public view into the same data, as well as how to implement enumerators in Go.
⦁ Chapter 8, Filesystem Backup, helps to build a simple but powerful filesystem backup tool for our code projects and explore interacting with the filesystem using the OS package from the Go standard library. It also looks at how Go's interfaces allow simple abstractions to yield powerful results.
⦁ Chapter 9, Building a Q&A Application for Google App Engine, shows how to build applications that can be deployed to Google's infrastructure and run at high scale with little to no operational duties for us. The project we build utilizes some of the cloud services available on Google App Engine, including the Google Cloud Datastore—.a highly available and extremely fast schema-less data storage option.
⦁ Chapter 10, Micro-services in Go with the Go Kit Framework, explores a modern software architecture paradigm whereby large monolithic applications are broken down into discrete services with a singular focus. The services run independently of each other, allowing them to be individually scaled to meet demand. Go Kit is a software framework that addresses some of the challenges of a microservice architecture while remaining agnostic to the implementation details.
⦁ Chapter 11, Deploying Go Applications Using Docker, looks at how simple it is to build Docker images to package and deploy the application we built in Chapter 9, Building a Q&A Application for Google App Engine. We will write a Dockerfile that describes the image, and use the Docker tools to build the image, which we will then deploy to the Digital Ocean cloud.