Golang: HTTP & Networking

Building RPC (Remote Procedure Call) Network in Go

RPC is an inter-process communication architecture to facilitate easy communication between two machines. In this article, we will learn APIs provided by the Go to build such a network.

Uday Hiwarale
RunGo
Published in
13 min readApr 24, 2020

--

(source: unsplash.com)

This lesson needs knowledge of working with HTTP servers in Go. I advise you to go through the tutorials mentioned in this list first or at least get yourself acquainted with the basic implementation of the HTTP server from this lesson.

Introduction to RPC

A procedure or a subroutine is a collection of instructions in a program to perform a specific task. This could be a function or a method of a class. When this procedure is invoked on the same machine, such as using a function call syntax producedure(), it is called a local procedure call.

When a procedure is executed remotely from a remote machine, it is called a remote procedure call. We can execute a remote procedure using any type of network connection like HTTP, WebSocket, AMQP, etc.

You would be familiar with the REST API architecture. When you to fetch or post data, you make an HTTP call to an /endpoint path with a…

--

--