goblet

command module
v0.0.0-...-a03fb21 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

README

Golang microservice app prototype

Inspired by Clean Architecture.

Application consists of configuration and Golang code. Configuration is concentrated in the root folder and config. Go code consists of common use packages and domain-specific ones. Common use packages are:

  • cmd − command-line tools
  • pkg/server − entry point for server-related code. Consists of REST and gRPC servers and its tools (utils, error handlers).
  • pkg/persistence − database & ORM handlers, database setup, migration & seed operations.
  • pkg/util − project-wide utility code, including database, cryptography, data migration, environment, etc

pkg/domain includes domain-specific packages, e.g. users, orders, articles. Each domain package may consist of the following parts:

  • model − models structs with JSON/YAML/XML serialization instructions. Usually model is a GORM db model with validations.
  • service − Service layer AKA Commands AKA Logic
  • rest − REST-specific routes controllers, middlewares. Uses CHI framework.
  • grpc − gRPC-specific controllers and middlewares.
  • form − forms and form validators
  • error − just typed errors

pkg/util packages consists of many (not always related) subpackages:

  • hash − different hash utils, for example base64 operations.
  • logger − Logrus library wrapper to be used in all parts of the app for logging.
  • securerandom − Golang's copy of Ruby's securerandom package. Used mostly for UUIDs generation.

Monitoring

Monitoring to be done via Prometheus/Grafana

Distributed logging

Logging is cloud-adapted and using ELK stack. https://github.com/deviantony/docker-elk/blob/master/docker-compose.yml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
domain/user/repository/orm
GORM-based implementation of Session Repository GORM-based implementation of User Repository
GORM-based implementation of Session Repository GORM-based implementation of User Repository
test

Jump to

Keyboard shortcuts

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