Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.3 KB

File metadata and controls

52 lines (33 loc) · 1.3 KB

Event Sourcing in Go

This is a playground to explore Event Sourcing, DDD, CQRS, and async architecture in standard lib Go code. The business logic models a greatly simplified e-commerce scenario simulating a distributed system with separate storage per service domain.

Points of Interest

  • Event-sourced aggregates
  • Transactional outbox integrated into task processing
  • Durable async task pool runner
  • Internal event bus with channel draining

Notes and Limitations

  • ES snapshots are not implemented
  • No application entry point — tests only

Storage Support

  • SQLite 3
  • PostgreSQL 9.1+

Running Tests

Use the Makefile:

E2E: make test.gateway

Run all tests: make test.all

Overload the default .env config: make test.all cfg=pg.example for file .env.pg.example

Event Code Generator

  1. Add new event struct declaration in events package: BaseEvent + payload fields.
  2. Update events/generate.go if needed.
  3. Run: make gen.events.

Diagrams

Architecture Flowchart
Event Flow Sequence

References