Skip to content

filipefernandes007/vagrant-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant 16.04 LTS Ubuntu Golang web development

We will install :

Install

git clone https://github.com/filipefernandes007/vagrant-go.git
cd vagrant-go
vagrant up

Apps folder

Your applications live in /home/vagrant/src

Access your virtual machine and apps folder

Your projects/apps must be under /home/vagrant/src folder.

vagrant ssh
cd src

Choose what to install

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.

GO environment variables

GOPATH environment variable points to /home/vagrant

GOROOT environment variable points to /usr/lib/go

GOBIN environment variable points to /home/vagrant/bin

Examples

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/

MYSQL Credentials and Client Access via SSH

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!

Releases

No releases published

Packages

No packages published