Skip to content

IacopoMelani/Go-Starter-Project

Repository files navigation

Go-Starter-Project

Template of a generic project written in GO Go CodeQL Build Status codecov Go Report Card Maintainability

The project uses Echo

For reading the .env file is used gotenv

Functionality 🍹

  • Definition of controllers
  • Definition of controllers GET and POST, in any case it is possible to define further methods
  • Data manipulation system retrieved from database MYSQL
  • Timed remote data recovery system
  • Queue request system
  • Configuration cache system via .env file
  • Database migration system

Installation

  • Clone or download the project in your own GOPATH
  • Download all dependecies with
go get -d ./...
  • Build the application
go build main.go
  • Ready to Go!

Configuration

In the root directory is present a .env.sample

export APP_NAME="Go-Starter-Project"
export STRING_CONNECTION="root:root@tcp(127.0.0.1:3306)/test?parseTime=true"
export APP_PORT=:8888
export USER_TIME_TO_REFRESH=30

Copy and rename in .env and fill with whatever you like

Useful commands

To interact with the application you need to FIRE!

Use the following command:

./Go-Starter-Project -fire

This will show the following message

commands:
  -fire go!         -> start the Server 
  -fire go-migrate  -> migrate database 
  -fire go-rollback -> rollback database 
  -fire go-config   -> show the current environment