go-service-template

module
v0.0.0-...-08d8c9a Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: BSD-3-Clause

README

go-service-template

Golang microservice template

Features
  • flat directory structure:
    • app - application logic and http server
    • cmd - main executable
    • internal - internal libraries
    • model - domains and models
    • store - data store
  • CLI based on kingpin
  • internal logging based on zerolog
  • http server:
    • based on httprouter
    • CORS enabled
    • timeouts enabled
    • context middleware
    • log_request middleware
  • store based on postgresql
    • reconnect if database is not available
    • custom pool settings
    • simple protocol enabled
TODO
  • instrumenting, tracing
  • read/write store pools
  • repeat database transactions if case of transport error
  • long queries canel on shutdown
  • pass context with deadline to store repositories

Directories

Path Synopsis
service
app
cmd

Jump to

Keyboard shortcuts

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