1- # TodoList example
1+ # Todo List
22
33A small Connect-based service that exercises ` go-eventually ` 's DDD / Event
4- Sourcing primitives end-to-end. It serves as a real-world litmus test for
5- the library's API: if something feels awkward in this example, it probably
6- needs rethinking in the library.
7-
8- ## What this example demonstrates
4+ Sourcing primitives end-to-end with:
95
106- An aggregate root (` todolist.TodoList ` ) with a child entity
117 (` todolist.Item ` ), built on ` aggregate.BaseRoot ` and
@@ -21,11 +17,6 @@ needs rethinking in the library.
2117- A Connect service exposing the above over HTTP/2 (h2c), with gRPC
2218 health + gRPC reflection wired up.
2319
24- Because the repository internally streams events through the new
25- ` message.Stream[event.Persisted] ` iterator, any request that triggers
26- ` AddTodoItem ` (which loads the existing aggregate) exercises the iterator
27- end-to-end.
28-
2920## Running
3021
3122``` sh
@@ -35,13 +26,6 @@ cd examples/todolist && go run .
3526# Server listens on :8080 by default
3627```
3728
38- The example is a member of the repository's Go workspace (` go.work ` at
39- repo root). The workspace is what resolves the ` go-eventually ` import
40- to the in-repo library code. The example's ` go.mod ` still carries a
41- ` require github.com/get-eventually/go-eventually v0.4.0 ` line as a
42- nominal floor — ` GOWORK=off ` would fall back to that released version,
43- which is NOT what you want when evaluating in-progress library changes.
44-
4529Hit it with a Connect client, ` grpcurl ` , or the built-in reflection:
4630
4731``` sh
@@ -50,7 +34,7 @@ grpcurl -plaintext -d '{"todo_list_id":"...","title":"chores","owner":"me"}' \
5034 localhost:8080 todolist.v1.TodoListService/CreateTodoList
5135```
5236
53- ## Design choices worth noting
37+ ## Design choices
5438
5539- ** Commands return ` google.protobuf.Empty ` .** Clients generate IDs and
5640 pass them in; the server acknowledges. Idempotent on retries with the
@@ -77,7 +61,7 @@ grpcurl -plaintext -d '{"todo_list_id":"...","title":"chores","owner":"me"}' \
7761 prefix to keep call sites terse and the domain boundary obvious at a
7862 glance.
7963
80- ## Regenerating the protos
64+ ## Protobuf generation
8165
8266``` sh
8367cd examples/todolist
@@ -87,10 +71,3 @@ buf generate
8771Committed output lives under ` gen/ ` ; regenerate after any proto change.
8872The buf configuration uses the v2 schema (see ` buf.yaml ` + ` buf.gen.yaml `
8973at the module root).
90-
91- ## CI coverage
92-
93- ` make go.lint ` and ` make go.test ` at the repo root iterate over every
94- Go workspace member (discovered from ` go.work ` ). This example is
95- therefore lint-gated and test-gated on every PR — a library change
96- that breaks the example fails CI.
0 commit comments