Skip to content

leocarmona/go-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-project-template

GitHub go.mod Go version

TL;DR:

make up

Prerequisites

Docker Docker-compose GNU Make GNU Bash

Table of Contents

About The Project

This is a project template for golang API projects based on Clean Architecture, Hexagonal Architecture and DDD.

Aiming to be simple as possible, this project follows Golang Standard Project Layout structure applying code patterns found in Uber Style Guide being a guide with useful ideas on writing Go code in general.

We use these following technologies in this project:

Environment Variables

Configure the following environment variables for local project execution:

Variable Default Value
SERVICE_NAME go-project-template
SERVICE_VERSION 0.0.1
ENVIRONMENT local
LAMBDA false
LOG_LEVEL debug
SERVER_HOST 0.0.0.0
SERVER_PORT 5000
SERVER_TIMEOUT 30
DB_READ_HOST localhost
DB_READ_PORT 5432
DB_READ_NAME go-project-template
DB_READ_USERNAME postgres
DB_READ_PASSWORD postgres123
DB_READ_LAZY_CONNECTION true
DB_READ_MIN_CONNECTIONS 2
DB_READ_MAX_CONNECTIONS 10
DB_READ_CONNECTION_MAX_LIFE_TIME 900
DB_READ_CONNECTION_MAX_IDLE_TIME 60
DB_WRITE_HOST localhost
DB_WRITE_PORT 5432
DB_WRITE_NAME go-project-template
DB_WRITE_USERNAME postgres
DB_WRITE_PASSWORD postgres123
DB_WRITE_LAZY_CONNECTION true
DB_WRITE_MIN_CONNECTIONS 2
DB_WRITE_MAX_CONNECTIONS 10
DB_WRITE_CONNECTION_MAX_LIFE_TIME 900
DB_WRITE_CONNECTION_MAX_IDLE_TIME 60
REDIS_HOST localhost
REDIS_PORT 6379
REDIS_PASSWORD
REDIS_DB 1
REDIS_LAZY_CONNECTION true

Environment variables separated by semicolon:

SERVICE_NAME=go-project-template;SERVICE_VERSION=0.0.1;ENVIRONMENT=local;LAMBDA=false;LOG_LEVEL=debug;SERVER_HOST=0.0.0.0;SERVER_PORT=5000;SERVER_TIMEOUT=30;DB_READ_HOST=localhost;DB_READ_PORT=5432;DB_READ_NAME=go-project-template;DB_READ_USERNAME=postgres;DB_READ_PASSWORD=postgres123;DB_READ_LAZY_CONNECTION=true;DB_READ_MIN_CONNECTIONS=2;DB_READ_MAX_CONNECTIONS=10;DB_READ_CONNECTION_MAX_LIFE_TIME=900;DB_READ_CONNECTION_MAX_IDLE_TIME=60;DB_WRITE_HOST=localhost;DB_WRITE_PORT=5432;DB_WRITE_NAME=go-project-template;DB_WRITE_USERNAME=postgres;DB_WRITE_PASSWORD=postgres123;DB_WRITE_LAZY_CONNECTION=true;DB_WRITE_MIN_CONNECTIONS=2;DB_WRITE_MAX_CONNECTIONS=10;DB_WRITE_CONNECTION_MAX_LIFE_TIME=900;DB_WRITE_CONNECTION_MAX_IDLE_TIME=60;REDIS_HOST=localhost;REDIS_PORT=6379;REDIS_PASSWORD=;REDIS_DB=1;REDIS_LAZY_CONNECTION=true;

Main Commands

Up

To start application and all dependenciove in this project, run:

make up

Down

To remove all docker containers downloaded and installed by this project, run:

make down

Testing

In progress ...

Documentation

In progress ...

About

This is a project template for golang API projects based on Clean Architecture, Hexagonal Architecture and DDD.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors