-
Notifications
You must be signed in to change notification settings - Fork 32
Development Environment Configuration
The installation process is quite simple. The first step it's to choose the go version that you wanna install. Just access the official site, and choose the desired version ( https://golang.org/dl/go1.16.5.linux-amd64.tar.gz). The recommendation it's always to download the most updated version.
To download on Linux, execute the command below on the terminal:
# select the version that you would like to install
VERSAO_GO=1.16.5
cd ~
curl -O "[https://golang.org/dl/go${VERSAO_GO}.linux-amd64.tar.gz](https://golang.org/dl/go1.16.5.linux-amd64.tar.gz)"
Now unpack the files with the following command:
tar xvf "go${VERSAO_GO}.linux-amd64.tar.gz"
Next, move the files to the bin directory of your Linux user:
sudo mv go /usr/local
Now test your go installation:
go version
In case of error, try to export the go path with the command below:
PATH=$PATH:/usr/local/go/bin
- Download link: https://www.jetbrains.com/pt-br/idea/
You can install using the following link:
https://code.visualstudio.com/download
Confirm that the VS Code was successful installed executing the command:
code .
Install the
For VS Code, you need to install some extensions. Install Luke Hoban. with the command below:
code --install-extension ms-vscode.go
When opening a Go file for the first time on VS Code, it will indicate which analysis tools are missing. Click on the button to install. You can check the complete list of tools here.
A good option to debug your programs in Go is Delve. It can be installed by using the go get
command:
go get -u github.com/go-delve/delve/cmd/dlv
- DBEaver
- Download link: https://dbeaver.io/
- Sublime Merge
- Download link: https://www.sublimemerge.com/
- Gitkraken
- Download link: https://www.gitkraken.com/
Or can use the command line, and in case of mistakes, OhShitGit! may help, it mentions strategies for getting out of git messes, tangles and other problems.
- Insomnia
- Download link: https://insomnia.rest/download
- Postman
- Download link: https://www.postman.com/downloads/
It's a script to help you to see your branch directly on your bash
-
Step
- Put this script at the end of your bashrc (~/.bashrc)
force_color_prompt=yes color_prompt=yes parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' fi unset color_prompt force_color_prompt
-
Step
Execute this command:
source ~/.bashrc
The minimal, blazing-fast, and infinitely customizable prompt for any shell!
Yakuake is a top-down terminal for KDE in the style of Guake for GNOME, Tilda, or the terminal used in Quake
https://www.youtube.com/watch?v=FPT1nJP8ogw&ab_channel=StefanoBiancorosso
sudo apt install yakuake
The official installation link is:
https://docs.docker.com/engine/install/ubuntu/
-
Update and install the packages:
sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release
-
Add the official docker GPG key:
curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
-
Add a stable Docker repository:
echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Update and install the docker packages:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
-
Check the Docker installation with the hello-world image:
sudo docker run hello-world
Follow this Linux postinstall tutorial, to use Docker without sudo
command (Linux postinstall)
If at the end of the installation you get the message below:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Try to start the Docker service using:
systemctl start docker
or
sudo service docker start
-
Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
To install a different version of Compose, substitute 1.29.2 with the version of Compose you want to use.
-
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
Note: If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.
For example:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
-
Test the installation.
docker-compose --version docker-compose version 1.29.2, build 1110ad01
We recommend the grpclient to consume the gRPC server as a client. grpcurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers.
The main purpose for this tool is to invoke RPC methods on a gRPC server from the command-line. gRPC servers use a binary encoding on the wire (protocol buffers, or "protobufs" for short). So they are basically impossible to interact with using regular curl (and older versions of curl that do not support HTTP/2 are of course non-starters). This program accepts messages using JSON encoding, which is much more friendly for both humans and scripts.
- Install grpcurl To install grpcurl, use the command below:
go get github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
- Usage To use the grpcurl, it's quite simple, like a curl, you just need to point to the url, port server and function that you want to call. e.g.
grpcurl -plaintext -d '{"policyID": "44363f4f-9d5e-4d6a-9a2c-74ed781ee368", "ownerID":"dea2aefd-0480-43da-aa41-bd6b2a11907"}' localhost:8282 policies.PolicyService/RetrieveDatasetsByPolicyID
Note: If you face any problem related to TLS, just add the
-plaintext
arg to your command.
In case you don't know the specific function that you would like to use, you can list the availiable functions with the command below:
grpcurl -plaintext localhost:8282 list policies.PolicyService
For more infos, you can access the repo on the grpcurl github page