gotem

module
v0.0.0-...-b30c35d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2020 License: MIT

README

gotem

a (try to be complete) go template. Includes:

  • echo framework (interceptor, middleware)
  • redis
  • rabbitmq
  • db migration
  • app server

running

make the db persistence:

  • docker volume create --name=postgresql
  • docker volume create --name=postgresql_data

starting the service as service:

  • docker-compose up -d

What it will do:

  • run postgres
  • run redis
  • run rabbitmq
  • apply database migration (up)
  • run app server

migration

if you need manual migration:

  • Migrate version up:
    migrate -database "postgres://root:root@localhost:54321/gotem_db?sslmode=disable" -path migration/scripts/ up

  • Migrate version down:
    migrate -database "postgres://root:root@localhost:54321/gotem_db?sslmode=disable" -path migration/scripts/ down

healthcheck

  • Get the container ID from gotem app:
    bondhan@syuhada:~/go/src/github.com/bondhan/gotem$ docker ps -aqf "name=gotem_gotem"
    c33e4831e74d

  • Inspect the health status:
    docker inspect c33 | jq '.[].State.Health'

Directories

Path Synopsis
cmd
internal
persistence

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL