- Golang 1.11.x
- Nginx (maybe for reverse proxy...)
- Mysql 5.7
- Sqlite3
- MongoDB 4.0
- Elasticsearch 6.4.2
- Java 8
- Redis latest stable
- Nodejs 10.x
- Git
- Go examples with gorm
- Glide to manage Go dependencies
git clone https://github.com/filipefernandes007/vagrant-go.git
cd vagrant-go
vagrant up
Your applications live in /home/vagrant/src
Your projects/apps must be under /home/vagrant/src folder.
vagrant ssh
cd src
At config/config.yml you can decide what to be installed in your virtual machine. Choose true for the dependencies you like to be installed.
GOPATH environment variable points to /home/vagrant
GOROOT environment variable points to /usr/lib/go
GOBIN environment variable points to /home/vagrant/bin
There are two examples that interact with database (mysql and sqlite), both depending on gorm, and gin for routing. They are just examples, and are not ready for production.
If you want to play with them, first run migrations and then fixtures:
cd src/<example>
go run migrations/main.go
go run fixtures/main.go
Verify the results:
go run main.go
and then click here: http://192.168.33.185:8085/people/
For mysql access you can use this credentials : root:root
For mysql access client via ssh :
- SSH Host : 192.168.33.185
- SSH User : vagrant
- SSH Password : vagrant
Enjoy!