Understanding HTTP Server in Go #1 - Basic

The net/http package in Go offers a powerful set of tools for constructing HTTP servers to handle incoming requests and send responses. In this article, we’ll dive into setting up a basic HTTP server. Before we delve into the specifics, let’s familiarize ourselves with a couple of key terms: Multiplexer (or Mux): This is an essential component of an HTTP server that routes incoming requests to the appropriate handlers based on the requested paths or URLs....

August 29, 2023 Â· 3 min Â· Suraj Narwade

Types of DNS records

While working with route53, I came across a couple of DNS records which were new to me. There are several types of DNS (Domain Name System) records, each with a specific purpose. Here are some of the most common types: A record (Address record) Maps a hostname to an IPv4 address. example.com IN A 192.0.2.1 AAAA record (IPv6 Address record) Maps a hostname to an IPv6 address. example.com IN AAAA 2001:db8::1 CNAME record (Canonical Name record) Maps an alias hostname to the true hostname (canonical name)....

August 23, 2023 Â· 2 min Â· Suraj Narwade

fmt in Golang - formatting I/O

fmt is one of the essential packages in Golang. fmt stands for “format.” This package allows us to format strings, print output, and interact with the standard input/output streams. In this blog post, we will explore the key functionalities of the fmt package. you can import the package as shown: import "fmt" Printing to standard output There are various functions available for printing such as fmt.Println , fmt.Print and fmt.Print...

July 30, 2023 Â· 3 min Â· Suraj Narwade

Using Go modules with a Private GitHub repository

working with open-source Go modules is more straightforward, you add them in Go mod files and run Go mod commands and it just works. Recently, I came across private Go modules usage in one of my projects at work and thought of writing about it so it can help someone :) if you have only one repo then you can do export GOPRIVATE=github.com/yourorg/yourrepo If you have more than one private module, you can run the following:...

July 28, 2023 Â· 1 min Â· Suraj Narwade

For loop in Golang

Unlike other Languages, Golang does not have multiple looping constructs. It has only one for. But, I think that’s enough to cover all the use cases, let’s see different variations of loops. Basic Loop In basic for loop, there are 3 elements, initialization: i := 1 condition: i<=5 post: i++ loop will continue to run until the postcondition is true. for i := 1; i <= 5; i++ { fmt.Println(i) } output:...

July 27, 2023 Â· 3 min Â· Suraj Narwade

Introduction to Kubernetes Clients

In this post, we will see different Kubernetes clients, the client is something that you can use to talk to the Kubernetes cluster. Mainly, there are 3 ways to talk to a cluster: kubectl Console/Dashboard programmatically using clients The Kubernetes community maintains clients in various languages in this repo. Since Kubernetes is in Golang, a client library known as client-go is widely used. But there are clients available in other interesting languages :)...

July 26, 2023 Â· 1 min Â· Suraj Narwade

How to manage multiple versions of Terraform?

Terraform is a popular tool for Infrastructure as a Code practice to manage Cloud Infrastructure using declarative ways. As Infrastructure grows, the number of projects grows, and there’s a fair chance that you may not have the same terraform versions among your projects. There can be various reasons for it. As a result, you may need multiple terraform versions installed on your machine, which can get a little tricky. Worry not....

February 24, 2023 Â· 3 min Â· Suraj Narwade