Gin builds Blog API’s (1) Project address:https://github.com/EDDYCJY/go … Thinking First of all, before an initial project starts, everyone should think about it All kinds of program configurations are written in code, okay Is it appropriate that the API error code is hard-coded into the program Db handle to everyoneOpen, ok Get public parameters such as ..
API’s, Models for Tag Project address:https://github.com/EDDYCJY/go … This major section will cover the following knowledge points: gin: Golang’s micro-frame with excellent performance beego-validation: beego’s form validation library used in this section,Chinese document gorm, a developer-friendly ORM framework,English document com, toolkit Writing Business Logic We began to write business code, blog articles will haveLabelThe concept of, ..
API’s, Models for writing Article Project address:https://github.com/EDDYCJY/go … Define interface The logic of writing this section, let’s define the interface! Get list of articles: GET(“/articles “) Get the specified article: POST(“/articles/:id “) New article: POST(“/articles “) Update the specified article: PUT(“/articles/:id “) Delete the specified article: DELETE(“/articles/:id “) Write routing logic InroutersThe v1 version of, ..
Use JWT for identity verification Original address:The Portal of Fans of Fried Fish In the previous sections, we have basically completed the writing of API’s However, there are still some very serious problems, for example, our current API can be called at will, which is obviously not perfect and has problems. Then we adoptjwt-go(GoDoc) to ..
Write a simple file log Original address:The Portal of Fans of Fried Fish In the previous section, we solved the problem that API’s can be accessed at will, so we have another problem now. Even our logs are output to the console, which is obviously unreasonable for a project, so this section is simply packagedlogLibrary, ..
Deploying Golang Applications to Docker Project address:https://github.com/EDDYCJY/go …(Get on the bus and support the wave)Original address:https://segmentfault.com/a/11 … Note: You need to install it before you start.docker, with a good mirror source This chapter source code inf-20180324-dockerOn the branch Starting from this chapter, the project catalog is based ongo-gin-exampleAs a benchmark (please be flexible with your ..
Custom GORM Callbacks GORM itself is powered by Callbacks, so you could fully customize GORM as you want Project address:https://github.com/EDDYCJY/go … GORM itself is callback driven, so we can completely customize GORM as needed to achieve our goal. Register a new callback Delete existing callbacks Replace an existing callback The order in which callbacks are ..
Golang Gin Practice Serialization 15 to Generate Two-dimensional Codes and Merge Posters Original address:Golang Gin Practice Serialization 15 to Generate Two-dimensional Codes and Merge PostersProject address:https://github.com/EDDYCJY/go … If it is helpful to you, welcome to Star. Preface In this chapter, the following functional details will be implemented: 1, generating a two-dimensional code 2. Merge Posters ..
Golang Gin Practice Serialization 16 Draw Text on Pictures Original address:Golang Gin Practice Serialization 16 Draw Text on PicturesProject address:go-gin-example Preface This chapter isSerial 15It is recommended to eat together. Main realizationDraw text on the merged posterThe function of the (this requirement is also very common), the content is relatively simple Realization What is used ..
I introduction Themis is a database auditing product developed by DBA team of Yixin Company, which can help DBA and developers to quickly discover database quality problems and improve work efficiency. Its name comes from the goddess of justice and law in Greek mythology. The name of the project implies that the platform judges the ..
Introduction: Themis is a database auditing product developed by DBA team of Yixin Company, which can help DBA and developers to quickly discover database quality problems and improve work efficiency. This platform can audit Oracle and MySQL databases in multiple dimensions (object structure, SQL text, execution plan and execution characteristics) to evaluate the design quality ..
Introduction Optimizing SQL is one of the common tasks of DBA. How to optimize a statement efficiently and quickly is a problem that every DBA often faces. In the daily optimization work, I found many operations are essential steps in the optimization process. However, repeated execution of these steps will cost DBA a a lot ..