Skip to main content

Class diagrams

Two UML class diagrams, both derived from the Go source: the domain types of the two aggregates, and the hexagonal ports with the adapters that implement them.

Domain model​

Source: internal/domain/content/content.go, commands.go, events.go, internal/domain/category/category.go, events.go, internal/domain/shared/shared.go. Unexported fields, getters and the snapshot types are omitted; Events stands for []shared.Event. The content package never imports the category package: it sees the tree only through Categories.

Ports and adapters​

Source: internal/application/ports/ports.go (the OUT ports), internal/application/usecases/deps.go (Deps), cmd/api/main.go and cmd/a2a/main.go (composition roots), internal/adapters/inbound/*, internal/adapters/outbound/*. The in-memory adapters are a test double: no cmd/** file imports them (TestRuntimeBinaryHasNoInMemoryAdapters), and the A2A adapter reaches only the two read use cases. The Postgres box stands for several types (ContentRepository, TreeRepository, CatalogItemRepository, Inbox, OutboxRepo, IdempotencyStore, UnitOfWork); the memory box implements the same ports for the unit and BDD suites. The Encoder runs inside OutboxRepo.Append, so events are stored already encoded.