Getting started with gRPC

grpc framework reference material: Official document teachingGetting started with grpc go https://www.cnblogs.com/hongjijun/p/13724738.html GRPC is a cross language, high-performance and general open source RPC framework developed by Google based on Protobuf. GRPC is designed based on HTTP/2 protocol and can provide multiple services based o ...

Posted by deeem on Thu, 28 Oct 2021 12:35:39 -0700

Fundamentals of golang network programming

golang network programming 1.TCP programming Processing flow of TCP server program: 1.Listening port 2.Receive client request to establish link 3.establish goroutine Process links. The TCP server code implemented using the net package of Go language is as follows: Server package main import ( "bufio" "fmt" "net" ) func proc ...

Posted by vinnier on Thu, 28 Oct 2021 12:18:46 -0700

Life cycle of HTTP request in Go service

Go language is a common and very suitable tool for writing HTTP services. This blog post discusses the routing of a typical HTTP request through a go service, involving routing, middleware and related issues such as concurrency. In order to have specific code for reference, let's start with this simple service code (from   Go by Example: ...

Posted by rajavel on Wed, 27 Oct 2021 19:02:34 -0700

Golang basic syntax

Slice slice Like an array, a slice represents a continuous collection of multiple elements of the same type, but the slice itself does not store any elements, but only a reference to an existing array.   The slice structure includes address, length and capacity. Address: the address of the slice generally refers to the memory address po ...

Posted by Das Capitolin on Sun, 24 Oct 2021 05:40:52 -0700

Go language Bible - Chapter 2 program structure

Chapter 2 program structure Go language, like other languages, a large program is composed of many program components. Variables hold values, and various operations form expressions. The basic types are aggregated into more complex data types such as structures and arrays. Then, for and if are used to organize and control the execution flow of ...

Posted by idotcom on Sat, 23 Oct 2021 07:27:40 -0700

Use of Go language JSON standard library

In Go language encoding/json The library provides complex functions to convert various types in Go to JSON format. We mainly use the following functions: Serialize a slice, structure or dictionary into a JSON format string [byte stream].Deserialize a JSON format string [byte stream] into a slice, structure or dictionary. serialize Serializat ...

Posted by vtolbert on Thu, 21 Oct 2021 13:04:14 -0700

Data structure STL -- implementation of comparator by golang

github address: GitHub - hlccd/goSTL  Comparator summary For some data structures with size comparison, it is very cumbersome to implement some size comparison every time. Especially for some officially set types, it will be simple to implement the comparison of their elements when introducing basic types into the data structure. At the s ...

Posted by Richter on Mon, 18 Oct 2021 15:48:26 -0700

Solve the problem of creating too many threads for Go file operation

Solve the problem of creating too many threads for Go file operation github code repository A remote file performance test service implemented using Go. It is used to record the tuning process and solve the problem of too many threads created by Go processing blocked file IO. 1. Configuration There is a config.json configuration file on the ...

Posted by sarabjit on Mon, 18 Oct 2021 11:34:54 -0700

Go Data Structure and Algorithms - Queues

introduce A queue is a special linear table. A queue allows data to be inserted at one end and retrieved at the other end, and the data in the queue follows the First In First Our (FIFO) rule. One end of the retrieved data is called the head of the queue, and the other end of the inserted data is called the end of the queue. Queues can be div ...

Posted by davejj on Fri, 15 Oct 2021 09:25:47 -0700

Learn Go: 12. Custom types and structures - Definitions

Address of official account Learn what How to customize a type? How to define a structure? How to initialize a structure? How to nest structures? How to define anonymous structures? How to alias a type? How to define structure labels? concept What is a custom type? When the built-in types in Go language, such as int, string, etc., cannot me ...

Posted by Leonardo Dantas on Mon, 11 Oct 2021 22:40:45 -0700