beego orm many to many query

First, correct the documentation of beego rel_tableSet the name of the automatically generated m2m relation tablerel_throughIf you want to use a custom m2m relationship table in an m2m relationshipSet its name in the format of pkg.path.ModelName through thiseg: app.models.PostTagRelPostTagRel table needs to have a relationship to Post and Tag ...

Posted by iii on Sat, 30 Nov 2019 20:18:16 -0800

Elastic search, gorang client aggregation query

At present, there is a requirement for es aggregation query in the monitoring project, which needs to be implemented in go language, The requirement is to query that an IP is in a time range, and the average value of each monitoring indicator in a time unit. It's a bit awkward. Here is the query statement of es. It's obvious that the two field ...

Posted by beanwebb on Sat, 30 Nov 2019 15:30:28 -0800

Golang implements requests Library

Simple package, convenient to use, like python's requests library. Github address Github Support GET,POST,PUT,DELETE application/json,application/x-www-form-urlencoded I won't support it: multipart/form-data Use The following are common examples: GET request; POST form submission, json submission, saving files, etc. Get func getText() ...

Posted by JamesyBHOY on Fri, 29 Nov 2019 13:23:41 -0800

Go GUI controls and signals

control Control Brief Control is the encapsulation of data and methods. Control has its own properties and methods. Property refers to the characteristics of the control. Method refers to some simple and visible functions of the control. For example, the button is a control. The button is square, with a picture inside. This is the appearance pr ...

Posted by weekender on Wed, 27 Nov 2019 13:33:41 -0800

Basic knowledge of function

1. Definition of function The format of Go language function definition is as follows: func function_name( parameter list ) return_types { //Function body } Function parameter Function if you use an argument, the variable can be called a parameter of the function. Formal parameters are like local variables defined in a function body. To c ...

Posted by KingOfHeart on Wed, 27 Nov 2019 06:20:45 -0800

Go pit filling: using Private warehouse as module dependency

This article is published synchronously in Personal blog. The development of Golang can be described as changing with each passing day, but this is not a commendatory term, but it is said that there are many imperfections in its performance and function. With the development of small versions, the same function will also have destructive chang ...

Posted by djrichwz on Tue, 26 Nov 2019 21:21:14 -0800

Encounter with go -- basic program structure in go

Preface When learning a language, it's hard to avoid learning from the simplest program structure. When mastering another development language (such as the famous java), these things will look like a fish in water. I'll share some simple examples below. Basic program structure Quickly assign values to some variables const ( NUM1 = 1 + iota ...

Posted by estan on Thu, 21 Nov 2019 08:43:30 -0800

The Path of Dependent Management in go mod

Writing a k8s operator defaultvm in kubebuilder mainly strings up the creation of ovn network and virtual machine to provide default available virtual machine for users. Kubebuilder is a framework for building the Kubernetes API based on CRD, which can be used to build APIs, Controller s, and Admission Webhook s. The code calls virtualmachine d ...

Posted by kelvin on Thu, 21 Nov 2019 01:08:02 -0800

The use of golang rabbitmq

The previous articles mentioned the fanout type exchange similar to broadcast, which supports the classified direct type exchange. Using the example of log in the exchange of direct type, we can distinguish the logs of info, debug, warn and error types. However, there may be further requirements in practice. I hope to see the error log informat ...

Posted by sssphp on Wed, 20 Nov 2019 00:24:27 -0800

The use of golang rabbitmq

In the second chapter, we talked about the exchange of fanout type. The fanout type exchange will send messages to all the queues that are bound with it, without distinguishing and filtering. But in reality, we often need to have filtering conditions to separate different messages and send them to different queues. For example, the log of the s ...

Posted by tommyboy123x on Tue, 19 Nov 2019 08:29:00 -0800