TCP Protocol TCP/IP(Transmission Control Protocol/Internet Protocol), a transport control protocol/inter-network protocol, is a connection-oriented, reliable, byte-stream-based Transport layer communication protocol. Because it is a connection-oriented protocol, data travels like water and there is sticky packet problem.
TCP Server A TCP serve ...
Posted by joebWI on Thu, 31 Mar 2022 20:26:40 +0300
gin framework route splitting and registration April 16, 2020 | Golang's article has been read 9334 times in total This paper summarizes some methods of route splitting and registration of gin framework that I have accumulated in my projects.
gin framework route splitting and registration Basic route registration The following basic gin route ...
Posted by beebum on Thu, 31 Mar 2022 09:58:27 +0300
Transferred from: https://my.oschina.net/solate/blog/3034188
For personal backup only, please see the original text
catalogue
Benchmark test
Writing benchmarks
Performance comparison
Combined with pprof
Flame diagram
Testing flags
Testing attention and tuning
Benchmark test
Benchmarking is mainly to evaluate the performance of th ...
1. hello world
First, pull the gin development framework
go get -u github.com/gin-gonic/gin
Let's start with hello world and see how gin builds an http server
package main
import "github.com/gin-gonic/gin"
func main() {
engine := gin.Default()
engine.GET("/ping", func(ctx *gin.Context) {
ctx.JSON(200, gin.H{
...
Posted by pedrolopes10 on Wed, 30 Mar 2022 10:14:23 +0300
prefaceWe will show you a go zero micro service example in detail through a series of articles. The whole series is divided into ten articles, and the directory structure is as follows:Environment constructionService splittingUser servicesProducts and services (this article)Order servicePayment servicesRPC service Auth authenticationService mon ...
Posted by sabien on Wed, 30 Mar 2022 04:45:09 +0300
Suppose a scenario, we need an application that separates the front end from the back end, and the server API uses ASP Net core development, there are two sets of front-end, one is the client for all users, the other is the management background for administrators, using ASP Net core hosting as the back-end + front-end web server. It should be ...
Posted by shailendra on Wed, 30 Mar 2022 00:29:54 +0300
Threads and coroutines
Thread: the smallest unit that the operating system can schedule operations. A process can contain multiple threads, which is the actual operation unit in the process.
**Coroutine: * * also known as micro thread. A coroutine is a lightweight thread in user mode. A coroutine has its own register context and stack. During ...
Posted by BrentNorin on Tue, 29 Mar 2022 11:01:05 +0300
Common code optimization points in Golang
Hello, I'm xuanmai blade.
This article wants to talk to you about the common code writing methods of golang. In golang, if you keep writing code on the front line, you will have some code routines and experience. These experiences represent your thinking and solving of some problems or a kind of problem ...
Posted by nnichols on Tue, 29 Mar 2022 05:03:00 +0300
Interest is the best teacher. HelloGitHub makes you interested in programming!
brief introduction
Hello GitHub shares interesting, entry-level open source projects on GitHub.
https://github.com/521xueweihan/HelloGitHub
There are practical projects, introductory tutorials, black technology, open source books, large factory open sour ...
Posted by moallam on Mon, 28 Mar 2022 06:47:08 +0300
1, Escape analysis
Heap: Generally speaking, it is managed manually, including manual application, allocation and release. Generally, the memory size involved is uncertain, and large objects are generally stored. In addition, its allocation is relatively slow and involves relatively many command actions
Stack: it is managed by the compiler and ...
Posted by shazam on Sun, 27 Mar 2022 22:14:48 +0300