Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Proyecto base de Golang, es una aplicación de plantilla para iniciar nuevos proyectos en Golang

Notifications You must be signed in to change notification settings

la-haus/golang-base-project

Repository files navigation

Sample Golang API

Cloning into the GOPATH

git clone [email protected]:la-haus/golang-base-project.git $GOPATH/src/github.com/la-haus/sample

Go to the project directory

cd $GOPATH/src/github.com/la-haus/sample

Requirements

  • go v1.16+
  • go module
  • mockery
  • swag

Build

  • Copy the sample configuration file and fill the right values according to your environment
cp .env.sample .env
  • Install dependencies:
go mod download
  • Generate Swagger doc:
go get github.com/swaggo/swag/cmd/swag
swag init -g router/router.go
  • Run test:
go test ./...
  • How to (re)generate mocks using Mockery tool:
mockery --all --dir interfaces --output ./tests/mocks

Open the API Docs

Then, once app is up and running, you can go to http://<host>:<port>/api/sample/docs/index.html

Environments

Required environment variables

  • SERVER_HOST: Host for the server
  • SERVER_PORT: Port for the server
  • DD_ENV: Datadog environment, values can be staging or production
  • DD_SERVICE: Datadog service name
  • DD_VERSION: Datadog service version
  • DATADOG_AGENT_HOST: Datadog agent hostname
  • DATADOG_AGENT_PORT: Datadog agent port

Contributors

  • Luis Pereira

License

This project is property of La Haus

About

Proyecto base de Golang, es una aplicación de plantilla para iniciar nuevos proyectos en Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published