How is the lease of etcd realized
What is the leaseWe all know that redis can set the expiration time of the key through the expire command to realize the ttl of the cache. Etcd also has a feature that can set the expiration time of the key, that is, Lease. However, in comparison, the applicable scenarios of the two are different. Etcd Lease is widely used in service registrati ...
Posted by php4geek on Wed, 09 Feb 2022 04:42:00 +0100
How does PHP communicate with the Go language?
In such a scenario, the php project needs to use a third-party function, and there happens to be a class library written in Golang. So the question comes, how to realize the communication between different languages? Let's have a look.
Conventional scheme
1. Write an http/TCP service with Golang, and php communicates with Golang through ht ...
Posted by method_man on Wed, 09 Feb 2022 04:19:29 +0100
Go methods and recipients
Go methods and recipients
The Method in Go language is a function that acts on a specific type of variable. This particular type of variable is called a Receiver. The concept of Receiver is similar to this or self in other languages.
The definition format of the method is as follows:
func (Receiver variable receiver type) Method name(paramet ...
Posted by hkay1 on Tue, 08 Feb 2022 23:55:41 +0100
Golang implements the delay queue of RabbitMQ
Before reading this article, you should have understood some concepts of RabbitMQ, such as queues, switches and so on.Introduction to delay queueMessages in a queue are consumed by consumers after being delayed for a period of time. Such a queue can be called delay queue.The application scenario of delay queue is very wide, such as: if there is ...
Posted by SargeZT on Tue, 08 Feb 2022 18:08:38 +0100
Do you know several Go concurrency control methods
introduction
In Golang, a goroutine can be opened through the go keyword. Therefore, it is easy to write concurrent code in go. However, how to effectively control these growines executed concurrently?
When it comes to concurrency control, many people may first think of locks. Golang also provides lock related mechanisms, including mutex sync ...
Posted by musicbase on Tue, 08 Feb 2022 08:42:23 +0100
7, Go programming mode: modifier
I wrote an article before< Functional programming of Python modifier >, this mode can easily assemble some functions to other functions, which can make your code simpler, or make some "small function" code more reusable, so that the functions in the code can be assembled freely like LEGO toys. Therefore, I have always been fond ...
Posted by blacksheepradio on Tue, 08 Feb 2022 03:10:01 +0100
8, GO programming mode: PIPELINE
In this article, we focus on the pipeline pattern in Go programming. Pipeline is no stranger to those who have used Unix/Linux command line. It is a technical method to splice various commands to complete a stronger function. Today, streaming processing, functional programming, and simple API orchestration of microservices by application gatewa ...
Posted by foevah on Tue, 08 Feb 2022 02:49:12 +0100
The most detailed gRPC(Go) tutorial in history - client load balancing
From: month https://lixueduan.com
Original text: https://www.lixueduan.com/post/grpc/12-client-side-loadbalance/ This paper mainly introduces the built-in load balancing strategy of gRPC and its configuration and use, including Name Resolver, ServiceConfig, etc.
For relevant codes of gRPC series, see Github
1. General
gRPC load balan ...
Posted by reddymade on Tue, 08 Feb 2022 00:52:13 +0100
kratos micro service framework mall actual user Service-1
kratos micro service framework mall actual user Service-1
Note: kratos, proto, wire and other command tools have been installed here. It is recommended to take a look at the official file To avoid execution failure
A brief introduction to kratos framework
Please read the official file
Create mall micro Service - User Service
Enter the lo ...
Posted by CAPTAINCAPSLOCK on Mon, 07 Feb 2022 21:11:06 +0100
GoFrame framework (RK boot): fast implementation of CSRF verification
introduceThis article describes how to pass rk-boot Implement the CSRF verification logic of the server.What is CSRF?Cross Site Request Forgery (English: Cross Site Request Forgery), also known as one click attack or session riding, usually abbreviated as CSRF or XSRF, is an attack method to coerce users to perform unintentional operations on t ...
Posted by Cailean on Mon, 07 Feb 2022 09:01:54 +0100