Gorm Source Analysis database/sql

brief introduction Gorm is one of the more ORM s used in the development of the Go language.It has a full range of functions: crud Association (contains one, contains many, belongs to, many-to-many, contains many) callback functions are available before and after CallBacks (create, save, update, delete, query find) Preload affair composite pri ...

Posted by DoctorWho on Tue, 04 Jun 2019 09:04:01 -0700

46. Accessing MySql database, adding, deleting, modifying, checking, connection pool and empty field processing

Compared with the previous section, go language access to MySql database can be better written, today we will talk about connection pooling. At the same time, it also demonstrates the processing of go language when the table field content is NULL. First, we build a new database, cofoxdb and data table user. Added Administrator Switch tab S ...

Posted by Dongowarrior on Sun, 26 May 2019 16:20:51 -0700

docker making process of mindoc online document interface system

Note: Mindoc is an online interface document editing system, Baidu will know it in a moment.GitHub address: https://github.com/lifei6671/mindoc Native machine: ubuntu16.04 + dockerCE2017.12 + mysql5.7 + git2.7.4 Since mirroring with dockerfile requires jumping to the Goldang.org website, you know it.I built it using a foreign VPS 1 git clone co ...

Posted by tHud on Fri, 17 May 2019 21:31:59 -0700

As a struct field, interface talks about anonymous interfaces in golang structure

In golang, the function of inheritance and override is realized by combination. Perhaps most of us usually use the writing of anonymous struct in struct. Have you ever seen the writing of anonymous interface in struct? Interface is an interface that is directly an anonymous segment in struct and is written in the standard library sort package a ...

Posted by Garth Farley on Wed, 15 May 2019 17:03:04 -0700

Introduction to Block Chain: Source Analysis of core-state in ETF (II)

In the second half of 2018, the block chain industry is gradually fading away from the impetuosity and rationality at the beginning of its development. On the surface, it seems that the demand and status of relevant talents are declining. But in fact, it is the gradual decline of the initial bubble that gives people more attention to the real t ...

Posted by toxic_brain on Sat, 11 May 2019 12:11:24 -0700

I-team Blog Full Text Retrieval of Elasticsearch Actual

I have always felt the shortcomings of the blog, but recently I found it difficult to find a blog I wrote before when it grew up. As a back-end developer, the owner felt he had enough clothes and clothes to eat, so he had the full-text search function of the blog, Elasticsearch, and thanks to a server sponsored by Phigo. Selection of Full Text ...

Posted by love_php on Sat, 11 May 2019 07:21:54 -0700

Go Socket Operational Notes

concept The first thing Socket does is translate it into a hole or socket. Two programs on the network exchange data through a two-way communication connection, one end of which is called a socket.The essence of Socket is programming interface, which is an IPC interface. (IPC: Inter-process communication) Unlike other IPC methods, it allows mul ...

Posted by jasonc310771 on Sat, 04 May 2019 07:30:39 -0700

TF-IDF algorithm-golang implementation

1. Introduction of TF-IDF algorithm TF-IDF (term frequency-inverse document frequency) is a commonly used weighting technology for information retrieval and text mining. TF-IDF is a statistical method used to assess the importance of a word to a document set or one of the documents in a corpus. The importance of words increases with the numbe ...

Posted by markmuir on Tue, 23 Apr 2019 23:06:34 -0700

Use of Go Scanner and Source Code Analysis

brief introduction The go standard library bufio.Scanner is literally a scanner and scanner. The data soldier cache is continuously read from a reader, and an injection function is provided to customize the partitioner. Four predefined segmentation methods are also provided in the library. ScanLines: Separated by newline characters ('n') Sca ...

Posted by dmarquard on Tue, 23 Apr 2019 21:12:34 -0700

go task scheduling 6 (etcd lease mechanism / automatic expiration)

It is very important to implement distributed optimistic locking. If the lock is out of order suddenly, the lock needs to be released automatically. So it takes a lifetime to lock it in an etcd.Overdue demonstration: package main import ( "context" "fmt" "go.etcd.io/etcd/clientv3" "time" ) func main() { var ( conf ...

Posted by mantona on Sat, 20 Apr 2019 20:48:33 -0700