Skip to content
CQRS/ES toolkit for Go
Go Makefile
Branch: master
Clone or download

Latest commit

maxekman Merge pull request #253 from maxekman/ISSUE-259/official-mongodb
ISSUE-259 / Use official MongoDB drivers
Latest commit 8ae04a0 Mar 31, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
aggregatestore Migrate UUID to google/uuid Jan 11, 2019
commandhandler Migrate UUID to google/uuid Jan 11, 2019
docs Add presentation from a talk Oct 27, 2017
eventbus Switch to the official mongo driver Mar 31, 2020
eventhandler Migrate UUID to google/uuid Jan 11, 2019
eventstore Switch to the official mongo driver Mar 31, 2020
examples Switch to the official mongo driver Mar 31, 2020
httputils Migrate UUID to google/uuid Jan 11, 2019
middleware Migrate UUID to google/uuid Jan 11, 2019
mocks Migrate UUID to google/uuid Jan 11, 2019
repo Switch to the official mongo driver Mar 31, 2020
types/mongodb Switch to the official mongo driver Mar 31, 2020
.gitignore Remove integration tests and move to 3 musketeers Aug 19, 2018
.travis.yml Update TravisCI to Go 1.14 Mar 26, 2020
AUTHORS Add AUTHORS file Mar 21, 2018
CHANGES.md Update CHANGES.md Sep 18, 2016
CODE_OF_CONDUCT.md Random change to trigger a new build Sep 26, 2018
CONTRIBUTING.md Add contribution guidelines Mar 21, 2018
LICENSE Initial commit Nov 17, 2014
Makefile Tidy up makefile, add mongo shell command Mar 31, 2020
PULL_REQUEST_TEMPLATE.md Update PR template Mar 26, 2020
README.md Added link to eh-nats EventBus implementation Oct 11, 2018
aggregate.go Migrate UUID to google/uuid Jan 11, 2019
aggregate_test.go Migrate UUID to google/uuid Jan 11, 2019
command.go Migrate UUID to google/uuid Jan 11, 2019
command_test.go Migrate UUID to google/uuid Jan 11, 2019
commandhandler.go Add AUTHORS file Mar 21, 2018
commandhandler_test.go Migrate UUID to google/uuid Jan 11, 2019
context.go Add AUTHORS file Mar 21, 2018
context_test.go Add AUTHORS file Mar 21, 2018
docker-compose.yml Lock versions of runtime dependencies Mar 31, 2020
entity.go Migrate UUID to google/uuid Jan 11, 2019
event.go Migrate UUID to google/uuid Jan 11, 2019
event_test.go Migrate UUID to google/uuid Jan 11, 2019
eventbus.go fix nil dereference panic in EventBusError when Event is nil Dec 19, 2018
eventbus_test.go fix nil dereference panic in EventBusError when Event is nil Dec 19, 2018
eventhandler.go Remove Publisher, let EventBus handle observers Sep 11, 2018
eventhandler_test.go Remove Publisher, let EventBus handle observers Sep 11, 2018
eventstore.go Migrate UUID to google/uuid Jan 11, 2019
go.mod Switch to the official mongo driver Mar 31, 2020
go.sum Switch to the official mongo driver Mar 31, 2020
matcher.go Add AUTHORS file Mar 21, 2018
matcher_test.go Migrate UUID to google/uuid Jan 11, 2019
repo.go Switch to the official mongo driver Mar 31, 2020

README.md

Build Status Coverage Status GoDoc Go Report Card

Event Horizon

Event Horizon is a CQRS/ES toolkit for Go.

NOTE: Event Horizon is used in production systems but the API is not final!

CQRS stands for Command Query Responsibility Segregation and is a technique where object access (the Query part) and modification (the Command part) are separated from each other. This helps in designing complex data models where the actions can be totally independent from the data output.

ES stands for Event Sourcing and is a technique where all events that have happened in a system are recorded, and all future actions are based on the events instead of a single data model. The main benefit of adding Event Sourcing is traceability of changes which can be used for example in audit logging. Additionally, "incorrect" events that happened in the past (for example due to a bug) can be compensated for with an event which will make the current data "correct", as that is based on the events.

Read more about CQRS/ES from one of the major authors/contributors on the subject: http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/

Other material on CQRS/ES:

Inspired by the following libraries/examples:

Suggestions are welcome!

Usage

See the example folder for a few examples to get you started.

Storage drivers

These are the drivers for storage of events and entities.

Local / in memory

There are simple in memory implementations of an event store and entity repo. These are meant for testing/experimentation.

MongoDB

Fairly mature, used in production.

AWS DynamoDB

https://github.com/seedboxtech/eh-dynamo

Messaging drivers

These are the drivers for messaging, currently only publishers.

Local / in memory

Fully synchrounos. Useful for testing/experimentation.

GCP Cloud Pub/Sub

Experimental driver.

Kafka

https://github.com/Kistler-Group/eh-kafka

NATS Streaming

https://github.com/v0id3r/eh-nats

Development

To develop Event Horizon you need to have Docker and Docker Compose installed.

To start all needed services and run all tests, simply run make:

make

To manualy run the services and stop them:

make services
make stop

When the services are running testing can be done either locally or with Docker:

make test
make test_docker
go test ./...

The difference between make test and go test ./... is that make test also prints coverage info.

Get Involved

License

Event Horizon is licensed under Apache License 2.0

http://www.apache.org/licenses/LICENSE-2.0

You can’t perform that action at this time.