chekov-0.1.1 doesn't have any documentation.
Table of Contents
Features
PostgresEventStore backend- Dispatch
CommandtoAggregate - Generate
EventfromAggregate - Store and notify
Eventwith subscriptions - Dispatch
EventtoEventHandler
Getting started
Choosing an EventStore backend
Chekov works only with Postgres backend for now. The choice is easy to make!
But some more backends need to be implemented, see the related issue.
Defining Aggregates
An Aggregate is a struct that hold a domain state. Here's an example of a UserAggregate:
/// Define an Executor for the `CreateUser` command
/// The result is a list of events in case of success
/// Define an Applier for the `UserCreated` event
/// Applier is a mutation action on the aggregate
Defining Commands
You need to create a struct per command, any type of struct can implement Command but we advise to use struct for a better readability.
A command can only produce (or not) one type of events and it targets a single Aggregate.
A command must have a single and unique identifier that is used to route the command to the right target.
Defining Events
An Event can be a struct or an enum.
Defining Saga
Not implemented yet