Go Programming Blueprints - Second Edition

Build real-world, production-ready solutions in Go using cutting-edge technology and techniques

Go Programming Blueprints - Second Edition

This ebook is included in a Mapt subscription
Mat Ryer

3 customer reviews
Build real-world, production-ready solutions in Go using cutting-edge technology and techniques
$0.00
$39.99
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786468949
Paperback394 pages

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. 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. Each project could form the basis of a start-up, which means they are directly applicable to modern software markets.

Table of Contents

Chapter 1: Chat Application with Web Sockets
A simple web server
Modeling a chat room and clients on the server
Building an HTML and JavaScript chat client
Tracing code to get a look under the hood
Summary
Chapter 2: Adding User Accounts
Handlers all the way down
Making a pretty social sign-in page
Endpoints with dynamic paths
Getting started with OAuth2
Tell the authorization providers about your app
Implementing external logging in
Summary
Chapter 3: Three Ways to Implement Profile Pictures
Avatars from the OAuth2 server
Implementing Gravatar
Uploading an avatar picture
Combining all three implementations
Summary
Chapter 4: Command-Line Tools to Find Domain Names
Pipe design for command-line tools
Five simple programs
Composing all five programs
Summary
Chapter 5: Building Distributed Systems and Working with Flexible Data
The system design
Installing the environment
Reading votes from Twitter
Counting votes
Running our solution
Summary
Chapter 6: Exposing Data and Functionality through a RESTful Data Web Service API
RESTful API design
Sharing data between handlers
Wrapping handler functions
Injecting dependencies
Responding
Understanding the request
Serving our API with one function
Handling endpoints
A web client that consumes the API
Running the solution
Summary
Chapter 7: Random Recommendations Web Service
The project overview
Representing data in code
Generating random recommendations
Summary
Chapter 8: Filesystem Backup
Solution design
The backup package
The user command-line tool
The daemon backup tool
Testing our solution
Summary
Chapter 9: Building a Q&A Application for Google App Engine
The Google App Engine SDK for Go
Google Cloud Datastore
Entities and data access
Google App Engine users
Transactions in Google Cloud Datastore
Querying in Google Cloud Datastore
Votes
Casting a vote
Exposing data operations over HTTP
Running apps with multiple modules
Deploying apps with multiple modules
Summary
Chapter 10: Micro-services in Go with the Go kit Framework
Introducing gRPC
Protocol buffers
Building the service
Modeling method calls with requests and responses
An HTTP server in Go kit
A gRPC server in Go kit
Creating a server command
Building a gRPC client
Rate limiting with service middleware
Summary
Chapter 11: Deploying Go Applications Using Docker
Using Docker locally
Deploying Docker images
Deploying to Digital Ocean
Summary

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

Authors

Table of Contents

Chapter 1: Chat Application with Web Sockets
A simple web server
Modeling a chat room and clients on the server
Building an HTML and JavaScript chat client
Tracing code to get a look under the hood
Summary
Chapter 2: Adding User Accounts
Handlers all the way down
Making a pretty social sign-in page
Endpoints with dynamic paths
Getting started with OAuth2
Tell the authorization providers about your app
Implementing external logging in
Summary
Chapter 3: Three Ways to Implement Profile Pictures
Avatars from the OAuth2 server
Implementing Gravatar
Uploading an avatar picture
Combining all three implementations
Summary
Chapter 4: Command-Line Tools to Find Domain Names
Pipe design for command-line tools
Five simple programs
Composing all five programs
Summary
Chapter 5: Building Distributed Systems and Working with Flexible Data
The system design
Installing the environment
Reading votes from Twitter
Counting votes
Running our solution
Summary
Chapter 6: Exposing Data and Functionality through a RESTful Data Web Service API
RESTful API design
Sharing data between handlers
Wrapping handler functions
Injecting dependencies
Responding
Understanding the request
Serving our API with one function
Handling endpoints
A web client that consumes the API
Running the solution
Summary
Chapter 7: Random Recommendations Web Service
The project overview
Representing data in code
Generating random recommendations
Summary
Chapter 8: Filesystem Backup
Solution design
The backup package
The user command-line tool
The daemon backup tool
Testing our solution
Summary
Chapter 9: Building a Q&A Application for Google App Engine
The Google App Engine SDK for Go
Google Cloud Datastore
Entities and data access
Google App Engine users
Transactions in Google Cloud Datastore
Querying in Google Cloud Datastore
Votes
Casting a vote
Exposing data operations over HTTP
Running apps with multiple modules
Deploying apps with multiple modules
Summary
Chapter 10: Micro-services in Go with the Go kit Framework
Introducing gRPC
Protocol buffers
Building the service
Modeling method calls with requests and responses
An HTTP server in Go kit
A gRPC server in Go kit
Creating a server command
Building a gRPC client
Rate limiting with service middleware
Summary
Chapter 11: Deploying Go Applications Using Docker
Using Docker locally
Deploying Docker images
Deploying to Digital Ocean
Summary

Book Details

ISBN 139781786468949
Paperback394 pages
Read More
From 3 reviews

Read More Reviews