currency-service

module
v0.0.0-...-47d9ccc Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0

README

currency-service

Handle all responsibility related to currency. This is a sample of implementation DDD with Layered Architecture, CQRS, SOLID Principle, and DI.

Dependencies

  1. RabbitMQ
  2. Redis
  3. Postgres

How to run

  1. Spinning up all the dependencies
    make spin-up-dependent-containers-locally
  1. Start up the currency service
    go run cmd/currency-service/main.go

How to test

  1. Without Coverage
    make test
  1. With coverage
    make test-coverage
Notes on testing

Due to issue with dockertest and rabbitmq, the testing on publisher and subscriber which using rabbitmq need to be done manually. Since the time to creating and destroy the container is overlapping with each test. When running the test for subscriber and publisher, you may retry it several times due to the timeout issue and the docker spin-up time. The testing provided only unit test and integration test for now.

Description

  1. User Interface is reflected by endpoints which responsible for handling the requests and generate responses
  2. Application Layer is reflected by application package which contains use cases
  3. Domain Layer is reflected by domain package which contains the business logic for specific domain
  4. Infrastructure Layer is reflected by infrastructure package which contains event for domain events, repository for repository layer, and external for external layer

Layered Architecture - Eric Evans, 2003

Documentation

API Documentation can be found inside /docs

Directories

Path Synopsis
cmd
internal
currency/application/command
Package command is a generated GoMock package.
Package command is a generated GoMock package.
currency/application/query
Package query is a generated GoMock package.
Package query is a generated GoMock package.
currency/domain/currency
Package currency is a generated GoMock package.
Package currency is a generated GoMock package.
currency/infrastructure/event/publisher
Package publisher is a generated GoMock package.
Package publisher is a generated GoMock package.
workaround for dockertest problem
currency/infrastructure/repository
Package repository is a generated GoMock package.
Package repository is a generated GoMock package.
lib

Jump to

Keyboard shortcuts

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