hi, Hello, I'm haohongfan.
Recently, when I was doing the cortex optimization of prometheus ecology, I encountered a problem of go mod. Let's share it here.
Why do I call the title: how to cheat Go mod? This is very interesting. We'll sell it here first, but it really breaks through the relevant features of Go mod. (well, Cao Da's Go mod ten ...
Posted by Jibberish on Fri, 24 Sep 2021 17:16:24 +0200
zabbix (5.0) deployment and installation
www.zabbix.com [official website]
1, zabbix client
1)agent2 New version adopted golang Language development client
2)agent2 The default is 10050 port, that is zabbix Port of the client
# Old client: ZABBIX agent
# New version client: zabbix-agent2
2, Client Deployment (zabbix-agent2 installat ...
Posted by Joeker on Tue, 21 Sep 2021 11:11:05 +0200
An interface is a type (defined by the type keyword)An interface defines the behavior specification of an object. Only the specification is defined and not implemented. Specific objects implement the specifications in detail.Interfaces limit the methods that structures must implement
1. Interface type
In the Go language, an ...
Posted by Ammar on Tue, 21 Sep 2021 00:24:07 +0200
Go has only one loop structure: for Cycle.
Basic for The loop consists of three parts separated by semicolons:
Initialization statement: executed before the first iterationConditional expressions: evaluate before each iterationPost statement: executed at the end of each iteration
The initialization statement is us ...
Posted by Fitzlegend on Mon, 20 Sep 2021 18:21:37 +0200
Error handling strategy
Error propagationretry Output the error and end the programOutput error messageIgnore directly
When a function call returns an error, the caller should choose the appropriate way to handle the error. There are many processing methods according to different situations. Let's take a look at the five commonly used methods ...
Posted by dxdolar on Fri, 10 Sep 2021 06:22:24 +0200
In the monitoring alert project, prometheus and alertmanager are used to implement the monitoring alert. Common indicators such as cpu are monitored by node_exporter, network connectivity is monitored by blackbox_exporter, etc. In the actual test, different network interrupts are constructed and service interruptions are cumbersome. ...
Posted by riceje7 on Thu, 09 Sep 2021 18:31:31 +0200
The operating system version for this article is CentOS-8.Ubuntu is the same.
[zy@study ~]$ cat /proc/version
Linux version 4.18.0-305.12.1.el8_4.x86_64 (email@example.com) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Wed Aug 11 01:59:55 UTC 2021
Download go installation files Select the packa ...
Posted by discorevilo on Fri, 03 Sep 2021 21:50:13 +0200
cron A library for managing timing tasks, using Go to achieve the effect of crontab command in Linux. We introduced a similar Go library before—— gron . gron code is small, which is better for learning. But its function is relatively simple, and it is no longer maintained. If there is a need for timed tasks, cron ...
Posted by vchris on Sat, 27 Jun 2020 09:10:13 +0200
1> An html page is made up of: head part, body part, internal css, internal js, external css, external js.Therefore, a layout file also needs to be split against these.
2> Create a new oneLayout.goController.Write an instance that references the layout file.The code is as follows:
Posted by ReD_BeReT on Wed, 24 Jun 2020 18:17:42 +0200
twirp Is a RPC framework based on Google Protobuf.Trp automatically produces server and client code by defining the service in the.proto file.Let's focus more on business logic.Huh?Isn't this gRPC?Unlike gRPC, which implements its own set of HTTP servers and network transport layers, twirp uses the standard library net/http.I ...
Posted by om.bitsian on Wed, 10 Jun 2020 19:04:20 +0200