Tiny example to show CQRS implementation using Go.
Tiny design of the "system" with main components and interactions in between
- TaskAPI - command API for sending tasks and updating them
- TaskStore - service accepting commands via RabbitMQ and saving it to DB. Exposes JSON-RPC API for reading
- TaskReadAPI - service reading tasks from store
- TaskData - common data structures
Each module has its makefile.
list of commands:
- make fmt
- make test
- make build
- make install
- make get
- make swagger - builds swagger schema
- make mocks - generates mocks
make mocks example usage
make mocks SOURCE=service/taskService.go DESTINATION=service/taskService_mock.go PACKAGE=service
Both require mockgen and swag installed to the system via go install
- RabbitMQ - runs on default port with credentials "admin:admin217"
- MariaDB - runs on default port with credentials "root:root4db"
Each microservice has /health endpoint to make sure it started