Tuesday 18 December 2018

Go basic knowledge notes

github gin /? (light weight framework)
 
r := gin.default()
 
ss -an | grep 8080 (find out whether a port has been listened)
 
 
import {
 
     classA ? or its just package
}
 
// object autpo
classA.function_in_classA();
 
 
  import {
     classA
 }
 
 
import {
 
     dir
}
 
 
dir.anypkg
 
// gin
c.DefaultQuery("Name", "Guest");
//
c.postForm('value');w
 
 
get name=xxx from url, or use default value guest
 
 
// move route handler to another module
 
// go auto compile, needs to set up a go project name after installation
// installation can be done in make file
 
// build explore?
~./vim (juns git vim file  https://github.com/junxie6/config_centos_v2.git
- git clone, tools will be there )
 
// Then Juns handy tool will be ready to use 
ctrl-j file system
ctrk-k opened file
 
 

GO reverse proxy:
https://github.com/wolfeidau/reverseproxy/blob/master/main.go

No comments:

Post a Comment