Book Image

Network Automation with Go

By : Nicolas Leiva, Michael Kashin
Book Image

Network Automation with Go

By: Nicolas Leiva, Michael Kashin

Overview of this book

Go’s built-in first-class concurrency mechanisms make it an ideal choice for long-lived low-bandwidth I/O operations, which are typical requirements of network automation and network operations applications. This book provides a quick overview of Go and hands-on examples within it to help you become proficient with Go for network automation. It’s a practical guide that will teach you how to automate common network operations and build systems using Go. The first part takes you through a general overview, use cases, strengths, and inherent weaknesses of Go to prepare you for a deeper dive into network automation, which is heavily reliant on understanding this programming language. You’ll explore the common network automation areas and challenges, what language features you can use in each of those areas, and the common software tools and packages. To help deepen your understanding, you’ll also work through real-world network automation problems and apply hands-on solutions to them. By the end of this book, you’ll be well-versed with Go and have a solid grasp on network automation.
Table of Contents (18 chapters)
1
Part 1: The Go Programming Language
6
Part 2: Common Tools and Frameworks
10
Part 3: Interacting with APIs

Introduction

Go has emerged as one of the top three most wanted programming languages according to the Stack Overflow Developer Survey 2021 (Further reading), and it has become the preferred choice for writing cloud-native applications such as Kubernetes, Docker, Istio, Prometheus, and Grafana.

Despite this, we still don't see this trend manifest in the network engineering community, where fewer than 20% of network engineers saying they currently use Go for their network automation projects, according to the NetDevOps 2020 survey (Further reading), even though 41% of Go developers say they use Go for network programming in Go Developer Survey 2020 Results (Further reading).

This book strives to address this disparity by offering a practical introduction to Go and network automation for network engineers who want to evolve network management and operation using Go, and software engineers wanting to get into network infrastructure automation. We also hope that this book may be useful to network automation engineers who know and use Python today but want to expand their skill set with a different programming language.

We start by discussing the benefits of Go from different angles and how they apply to the networking field. By the end of this chapter, you should have a good understanding of the main aspects of Go and how to get Go installed on your computer to follow along with the code examples.

In this first chapter, we cover the following topics:

  • Networking and Go
  • Why Go?
  • The future of Go
  • Go versus Python
  • Installing Go on your computer