Using vscode to build Golang development environment on Mac platform

This article introduces how to use visual studio code to build golang development environment and debug environment on Mac platform. 1. brew install golang # install brew install golang # Check whether the installation is successful $ go version go version go1.12.7 darwin/amd64 $ brew info go go: stable 1.13.3 (bottled), HEAD Open source progra ...

Added by Codewarrior123 on Tue, 29 Oct 2019 12:09:10 +0200

Redis optimizes high and fast performance

Content of this article Using Redis to optimize interface performance in high concurrency scenarios Database optimistic lock With the approaching of the double 11, all kinds of promotional activities began to become popular, and the mainstream ones are seckill, coupons, and so on. The main scenarios involving high concurrency competing for th ...

Added by nOw on Tue, 29 Oct 2019 12:06:26 +0200

How to visualize the dependency of Go Module

This paper First appeared in My blog , if you think it's useful, please like the collection and let more friends see it. Recently, I developed a very simple tool, the total code is less than 200 lines. Today, briefly introduce it. What tool is this? It is a tool for visualizing Go Module dependencies. Why development Why do you want to develop ...

Added by altexis on Wed, 23 Oct 2019 09:06:16 +0300

How to delete k8s resource objects in batch

This article was first published on the public account [my little bowl soup] to scan the QR code at the end of the article for attention, exchange and study together In cloud platform development and middleware containerization, there is often a need to delete k8s resource objects in batches. Here are some examples of kubectl and golang sending ...

Added by obsidian on Wed, 16 Oct 2019 05:11:19 +0300

Source Code Analysis of Garbage Collector in kubernetes Garbage Recycler

kubernetes version: 1.13.2 background Because of the redis cluster created by the operator, the redis cluster is deleted abnormally (including the redis exporter statefullset and redis statefullset) after the kubernetes APIs server is restarted. After deletion, the operator rebuilds and reorganizes the cluster, and the instance IP changes (mi ...

Added by Whitestripes9805 on Wed, 16 Oct 2019 04:54:16 +0300

Use Go to Complete User Business Logic

brief introduction Routing overview Define handler Calibration parameter Encrypted Password and Data Storage Other handler s Get the user list Update user summary The current part of the code brief introduction In the previous section, you've learned roughly how to use Gin to read and write requests.This section is the practice, compl ...

Added by prasadharischandra on Sat, 12 Oct 2019 07:16:37 +0300

Make your own docker image and publish it to k8s

This article mainly describes how to generate docker image from your program and publish it to k8s environment. Before that, you need to understand the basic docker usage, basic k8s concepts and commands. Step1 CodingTo facilitate the use of the previous code, put the KV value into the ETC cluster. The code is as follows: package main import ...

Added by geekette on Fri, 11 Oct 2019 01:02:44 +0300

Implementing Goroutine Pool through Channel

Recent use of Go to import data from Excel into the server is for http requests But there is a problem that new Goroutine will be added indefinitely after reading from the file. Causes all cards to be stuck in the initialization request and then gets stuck. Problem simulation Simulation code func main() { pool := sync.WaitGroup{} for ...

Added by drucifer on Thu, 10 Oct 2019 03:20:03 +0300

Simple Implementation of HTTP Service Middleware in Go

Usually a simple http service framework is to register a bunch of routes and then call different logic to process them according to the routing. But in fact, there may be some uniform processing involved in almost all routes, such as logging, such as permissions and so on. So it's a good idea to do a pretreatment in the middle at this time. ...

Added by jsbrown on Sun, 06 Oct 2019 19:18:03 +0300

Connect MongoDB on aliyun using the authenticationDatabase parameter

Usually, we do this by connecting MongoDB from the command line: mongo -u <user> -p <pass> --host <host> --port 28015 Or use the standard connection string address URI: mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[database][?options]] # for example mongo mongodb://127.0.0.1:27017 It can also be used direct ...

Added by vaaaska on Sat, 05 Oct 2019 19:12:57 +0300