Skip to content

terraskye/eventsourcing Documentation

A Go library for building event-sourced systems with CQRS support.

go get github.com/terraskye/eventsourcing

Tutorials

Step-by-step guides to learn event sourcing by building a real application.

A runnable version of everything built across these parts lives in examples/todolist.


How-to guides

Practical recipes for specific tasks.

Commands - Handle concurrency conflicts with optimistic locking - Add metadata to events - Customise stream names (multi-tenancy) - Retry when you cannot tell whether an append landed - The aggregate variant — when to use it and when not to

Events - Register events for serialization - Version events when the schema changes - Read an event's old shape with UnmarshalJSON

Queries - Build a projection - Rebuild a projection without downtime - Move from the event bus to a projection runner

Infrastructure - Use KurrentDB as the event store - Add OpenTelemetry tracing - Use middleware, such as structured logging - Test event-sourced code


Reference

Complete API documentation.


Explanation

Background reading to understand the design and concepts.