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
As we explained in the previous section, gin can use the ShouldBind method to bind parameters to a structure, but we don't cover how parameter checking works. In this section, we describe how parameter checking and checking fail and then convert to Chinese to return to the front end.
1. Data Validation
Let's start with a simple example:
Posted by tsukushi on Mon, 08 Jun 2020 18:55:59 +0200
Start queue service
Use queue service
When a third-party API is called, there are basically restrictions on the access speed limit. When there are multiple third-party APIs, it is not good to control the access speed, which often leads to HTTP 429(Too Many Requests) and then it will be banne ...
Posted by SauloA on Sun, 31 May 2020 10:17:47 +0200
Golang also provides reflection mechanism, like Java, which obtains information about objects at run time and updates their internal state; Golang obtains object types, field types and values, calls struct instance methods, updates instance values, and so on.
_Go Gos The two most important objects and functions related to reflection in the refl ...
Posted by mistercoffee on Tue, 19 May 2020 19:19:09 +0200
LeetCode -- longest substring without duplicate characters
The information in this article comes from the Internet and personal summary, which is intended to summarize personal learning and experience. If there is any infringement, please contact me to delete it. Thank you!
leetcode Question, Interview 48
The longest ...
Posted by calevans on Sun, 03 May 2020 05:39:23 +0200
Recently, I bought domain name and server by chance. It's not really a waste. In addition, I haven't owned my own personal website, so I plan to play on the server with hexo, so I don't have to worry about whether to use Github pages or Gitee pages. Of course, today's topic is not blog building, but how to use Github's hook to deploy blog code ...
Posted by CodeMama on Sun, 26 Apr 2020 04:50:10 +0200
Gin Web Framework
web framework developed based on httprouter: https://github.com/gin-gonic/gin
Provides Martini style API, but 40 times faster than Martini
Very lightweight, simple to use
Installation and use of Gin framework
Install: go get -u github.com/gin-gonic/gin
Posted by ericwright17 on Sun, 19 Apr 2020 16:23:46 +0200
Tracking profiling is not available for most services.But if you encounter the following problems, you might as well try:
Suspect which partnership is slow
System call problem
Collaborative scheduling problems (chan interaction, mutex, semaphore, etc.)
It is suspected that gc (Garbage-Collect) affects service performance
Posted by eth0g on Fri, 17 Apr 2020 04:53:25 +0200