Welcome back to the Building the Web Server series. In the last article, we learned how to write a basic RPC server in Go using the native package provided by GoLang. We have used plain English to receive requests and send responses from our server till now. In this article, we will move away from that in search of more optimal ways to transfer data.
Why should we send data in XML, JSON, or any other human-readable format if there is no need for us to understand what the services are talking about directly? As long as we can still…
Hey fellow coders, in the last article we learned how to Write Fx Modules and added a logging module into our project. Continuing on the same codebase, we will add support for serving RPC requests.
RPC stands for Remote Procedure Call. It is a type of Inter-Process Communication that uses the indirect method of passing messages across the receiver and sender in-order to establish a channel between the two.
RPC is generally used in client/server architectures for communication. The primary reason for RPC being widely used and accepted is the power to decouple the physical and logical layers. …
In the previous article, we explored how we can convert a manually wired HTTP web server into a DI based web server using the Fx library. Now once we have that in place, our next step is to add functionalities to our server .i.e business logic. But before we jump into that, we need to first understand how to write modules for our Fx Server. These modules will act as building blocks for our application.
Generically speaking, a module is a piece of program that is independent and interchangeable, such that each module contains everything necessary to execute only one…
As professionals, we should never stop learning. Learning is the one true way to ensure we stay in demand and continue delivering value to our customers. Doctors, lawyers, and scientists are all highly respected professionals and all focus on continuously learning. Why should programmers be different?
Hence, continuing where we left in the previous article. Once we have a basic HTTP server in GoLang up and running, the next step is to build the base for the project so that we can write more and more code easily to cater to varied use cases of the service.
When you read the term web server, what pops up in your mind? Having worked on Java before I moved on to GoLang, the very first thing that comes to me is Spring and its complex configurations. So, here I welcome you to the world of GoLang where things are as simple as they can be.
Prerequisites: Basics of GoLang, Basics of how HTTP works.
A typical way to write a ‘hello world’ web server is to have an HTTP server up and running some route through which the browser can interact with the server.
In the below code snippet…
Re-living Amritsar, 4th Jan 2020
I and my friend decided to visit the holy land of Sikhs on the first weekend of 2020 and what a blissful weekend it turned out to be. Have you ever had vegetarian food that makes you feel high? Have you had a chance to enjoy the authentic Amritsari Lassi from those tall brass tumblers? Or did you witness the sunset at Wagah with the smell of patriotism in the air? If not, visit Amritsar!
We started late at night around 11 from ISBT Kashmere Gate and reached early in the morning around 7 a.m…
With this one I continue to explore GORM through the series of articles. In the past, I have talked about my learnings about GORM and shared plugins like audit and batch upsert. In this article, I want to share the experiences I had while using two different ORMs, GORM(MySQL) and XORM(Oracle) namely, for handling two different databases.
I also took this opportunity to explore the overall state of ORMs in Golang and will try to throw some light on it. So, let’s get started.
First, I would like to explain how I ended up using two ORMs, even worse, two…
GORM is the ORM library for Golang, built and maintained by Jinzhu. Since you have stumbled upon this article I would safely assume that you have been coding using GoLang for a while now and a GORM user already.
I have been working with gorm for a while now and recently had a use case where I wanted to perform bulk writes to MySQL database. Upon exploring the documentation, I found that gorm doesn’t support bulk writes/updates (in V1). I went through the open items on their GitHub repo and found some helpful comments which led me to write this small function, which supports batch upserts for GORM.
Update: GORM V2 provides bulk operations out of the box.
Please find all of my gorm-plugin listed here.
GORM is the ORM library for Golang, built and maintained by Jinzhu. Since you have stumbled upon this article I would safely assume that you have been coding using GoLang for a while now and a GORM user already.
I have been working with gorm for a while now and recently had a use case where I wanted to update the audit columns (who, when fields) without exclusively defining it for all the DB calls. Essentially what I was looking for is a way to handle the setting of audit for my queries behind the scenes without me writing the…
I just hate it, the way they are
It’s her or is it he?
Untold, unspoken, dark, gloomy
Dull, devoid, drained, ignored
I just love her, the way she is
It’s her eyes or is it the nose?
Sparkling, energetic, caring
Lovable, cute, sweet, charismatic
I am amazed, at the bonding
It’s understanding or an adjustment?
Awkward, undefined, loosened
Thinning, slogging, hurting, paining
I am wondering, about this poem
It’s feelings or mere adjectives?
If I can find some more
Fearful, what might those be
— Sumit Agarwal