Book description
Build real-world, production-ready solutions by harnessing the powerful features of Go
About This Book
An easy-to-follow guide that provides everything a developer needs to know to build end-to-end web applications in Go
Write interesting and clever, but simple code, and learn skills and techniques that are directly transferable to your own projects
A practical approach to utilize application scaffolding to design highly scalable programs that are deeply rooted in go routines and channels
Who This Book Is For
This book is intended for developers who are new to Go, but have previous experience of building web applications and APIs.
What You Will Learn
Build a fully featured REST API to enable client-side single page apps
Utilize TLS to build reliable and secure sites
Learn to apply the nuances of the Go language to implement a wide range of start-up quality projects
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
Explore the core syntaxes and language features that enable concurrency in Go
Understand when and where to use concurrency to keep data consistent and applications non-blocking, responsive, and reliable
Utilize advanced concurrency patterns and best practices to stay low-level without compromising the simplicity of Go itself
In Detail
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. It is a statically typed language with syntax loosely derived from that of C, adding garbage collection, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.
This course starts with a walkthrough of the topics most critical to anyone building a new web application. Whether its keeping your application secure, connecting to your database, enabling token-based authentication, or utilizing logic-less templates, this course has you covered.
Scale, performance, and high availability lie at the heart of the projects, and the lessons learned throughout this course will arm you with everything you need to build world-class solutions. It will also take you through the history of concurrency, how Go utilizes it, how Go differs from other languages, and the features and structures of Go's concurrency core. It will make you feel comfortable designing a safe, data-consistent, and high-performance concurrent application in Go. This course is an invaluable resource to help you understand Go's powerful features to build simple, reliable, secure, and efficient web applications.
Style and approach
This course is a step-by-step guide, which starts off with the basics of go programming to build web applications and will gradually move on to cover intermediate and advanced topics. You will be going through this smooth transition by building interesting projects along with the authors, discussing significant options, and decisions at each stage, while keeping the programs lean, uncluttered, and as simple as possible.
Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.
Table of contents
-
Go: Building Web Applications
- Table of Contents
- Go: Building Web Applications
- Go: Building Web Applications
- Credits
- Preface
- 1. Module 1
-
2. Module 2
- 1. Chat Application with Web Sockets
- 2. Adding Authentication
- 3. Three Ways to Implement Profile Pictures
- 4. Command-line Tools to Find Domain Names
- 5. Building Distributed Systems and Working with Flexible Data
- 6. Exposing Data and Functionality through a RESTful Data Web Service API
- 7. Random Recommendations Web Service
- 8. Filesystem Backup
-
3. Module 3
- 1. An Introduction to Concurrency in Go
- 2. Understanding the Concurrency Model
- 3. Developing a Concurrent Strategy
- 4. Data Integrity in an Application
- 5. Locks, Blocks, and Better Channels
- 6. C10K – A Non-blocking Web Server in Go
- 7. Performance and Scalability
-
8. Concurrent Application Architecture
- Designing our concurrent application
- Identifying our requirements
- Using NoSQL as a data store in Go
- Monitoring filesystem changes
- Managing logfiles
- Handling configuration files
- Detecting file changes
- Backing up our files
- Designing our web interface
- Reverting a file's history – command line
- Checking the health of our server
- Summary
- 9. Logging and Testing Concurrency in Go
-
10. Advanced Concurrency and Best Practices
- Going beyond the basics with channels
- Building workers
- Implementing nil channel blocks
- Implementing more granular control over goroutines with tomb
- Timing out with channels
- Building a load balancer with concurrent patterns
- Choosing unidirectional and bidirectional channels
- Using an indeterminate channel type
- Using Go with unit testing
- Using Google App Engine
- Utilizing best practices
- Summary
- A. Bibliography
- Index
Product information
- Title: Go: Building Web Applications
- Author(s):
- Release date: August 2016
- Publisher(s): Packt Publishing
- ISBN: 9781787123496
You might also like
book
Hands-On Full Stack Development with Go
Create a real-world application in Go and explore various frameworks and methodologies for full-stack development Key …
video
Building and leveraging REST APIs with Go
This chapter details the process of writing REST APIs with Go. This chapter starts with basics …
video
Building full-stack web applications with Go
Building full stack web applications requires drawing on several big technologies, including database access, HTTP routing, …
article
Use Github Copilot for Prompt Engineering
Using GitHub Copilot can feel like magic. The tool automatically fills out entire blocks of code--but …