[![PkgGoDev](https://pkg.go.dev/badge/github.com/looplab/eventhorizon)](https://pkg.go.dev/github.com/looplab/eventhorizon)
![Build Status](https://github.com/looplab/eventhorizon/actions/workflows/test.yml/badge.svg)
[![Coverage Status](https://img.shields.io/coveralls/looplab/eventhorizon.svg)](https://coveralls.io/r/looplab/eventhorizon)
[![Go Report Card](https://goreportcard.com/badge/looplab/eventhorizon)](https://goreportcard.com/report/looplab/eventhorizon)
# 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:
- http://martinfowler.com/bliki/CQRS.html
- http://cqrs.nu
- https://groups.google.com/forum/#!forum/dddcqrs
Inspired by the following libraries/examples:
- https://github.com/edumentab/cqrs-starter-kit
- https://github.com/pjvds/go-cqrs
- http://www.codeproject.com/Articles/555855/Introduction-to-CQRS
- https://github.com/qandidate-labs/broadway
Suggestions are welcome!
# Usage
See the example folder for a few examples to get you started.
# Get Involved
- Join our [slack channel](https://gophers.slack.com/messages/eventhorizon/) (sign up [here](https://invite.slack.golangbridge.org/))
- Check out the [contribution guidelines](CONTRIBUTING.md)
# Event Store Implementations
### Official
- Memory - Useful for testing and experimentation.
- MongoDB - One document per aggregate with events as an array. Beware of the 16MB document size limit that can affect large aggregates.
- MongoDB v2 - One document per event with an additional document per aggregate. This event store is also capable of keeping track of the global event position, in addition to the aggregate version.
- Recorder - An event recorder (middleware) that can be used in tests to capture some events.
- Tracing - Adds distributed tracing support to event store operations with OpenTracing.
### Contributions / 3rd party
- AWS DynamoDB: https://github.com/seedboxtech/eh-dynamo
- Postgress: https://github.com/giautm/eh-pg
- Redis: https://github.com/TerraSkye/eh-redis
# Event Bus Implementations
### Official
- GCP Cloud Pub/Sub - Using one topic with multiple subscribers.
- NATS - Using Jetstream features.
- Kafka - Using one topic with multiple consumer groups.
- Local - Useful for testing and experimentation.
- Redis - Using Redis streams.
- Tracing - Adds distributed tracing support to event publishing and handling with OpenTracing.
### Contributions / 3rd party
- Kafka: https://github.com/Kistler-Group/eh-kafka
- NATS Streaming: https://github.com/v0id3r/eh-nats
# Repo Implementations
### Official
- Memory - Useful for testing and experimentation.
- MongoDB - One document per projected entity.
- Version - Adds support for reading a specific version of an entity from an underlying repo.
- Cache - Adds support for in-memory caching of entities from an underlying repo.
- Tracing - Adds distributed tracing support to an repo operations with OpenTracing.
# Development
To develop Event Horizon you need to have Docker and Docker Compose installed.
To run all unit tests:
```bash
make test
```
To run and stop services for integration tests:
```bash
make run
make stop
```
To run all integration tests:
```bash
make test_integration
```
Testing can also be done in docker:
```bash
make test_docker
make test_integration_docker
```
# License
Event Horizon is licensed under Apache License 2.0
http://www.apache.org/licenses/LICENSE-2.0
没有合适的资源?快使用搜索试试~ 我知道了~
Event Sourcing for Go!.zip
共209个文件
go:179个
md:8个
yml:5个
需积分: 5 0 下载量 175 浏览量
2023-12-28
20:52:57
上传
评论
收藏 760KB ZIP 举报
温馨提示
Event Sourcing for Go!
资源推荐
资源详情
资源评论
收起资源包目录
Event Sourcing for Go!.zip (209个子文件)
AUTHORS 530B
styles.css 7KB
base.css 2KB
Dockerfile 1KB
Main.elm 15KB
Todo.elm 10KB
.gitignore 336B
.gitignore 18B
handler_test.go 20KB
eventstore.go 20KB
eventhandler_test.go 15KB
aggregate_test.go 14KB
mocks.go 14KB
eventstore.go 13KB
outbox.go 13KB
acceptance_testing.go 11KB
eventbus.go 11KB
repo.go 11KB
command_check_test.go 10KB
eventhandler.go 9KB
middleware.go 9KB
aggregatestore_test.go 9KB
middleware_test.go 9KB
eventbus.go 9KB
acceptance_testing.go 9KB
main.go 8KB
eventbus.go 8KB
eventstore_test.go 8KB
eventbus.go 8KB
outbox_test.go 8KB
repo_test.go 8KB
event.go 8KB
outbox.go 8KB
mongodb_test.go 7KB
eventstore.go 7KB
aggregatestore.go 7KB
acceptance_testing.go 7KB
aggregatestore_test.go 6KB
repo_test.go 6KB
outbox.go 6KB
memory_test.go 6KB
event_test.go 6KB
eventbus.go 6KB
acceptance_testing.go 6KB
context.go 6KB
eventbus_test.go 6KB
projector_test.go 6KB
aggregate.go 6KB
commands.go 5KB
aggregatebase_test.go 5KB
eventstore_test.go 5KB
maintenance_testing.go 5KB
aggregate.go 5KB
command_test.go 5KB
commandhandler_test.go 5KB
projectors.go 5KB
acceptance_testing.go 5KB
repo.go 5KB
repo.go 4KB
eventstore.go 4KB
eventstore.go 4KB
eventmaintenance.go 4KB
command.go 4KB
eventstore.go 4KB
repo.go 4KB
aggregate_test.go 4KB
eventbus_test.go 4KB
aggregate.go 4KB
setup.go 4KB
repo.go 4KB
matcher_test.go 4KB
repo.go 4KB
aggregatebase.go 3KB
eventhandler.go 3KB
eventmaintenance.go 3KB
event.go 3KB
compare.go 3KB
event.go 3KB
command_check.go 3KB
context_test.go 3KB
eventhandler.go 3KB
middleware_test.go 3KB
handler.go 3KB
commands.go 3KB
eventhandler.go 3KB
outbox_test.go 3KB
repo.go 3KB
eventstore_test.go 3KB
projector.go 3KB
middleware.go 3KB
middleware.go 3KB
eventstore_test.go 3KB
context.go 3KB
performance_testing.go 3KB
aggregatestore.go 3KB
eventmaintenance.go 3KB
eventbus_test.go 3KB
eventbus.go 3KB
eventbus.go 3KB
middleware_test.go 3KB
共 209 条
- 1
- 2
- 3
资源评论
Lei宝啊
- 粉丝: 2006
- 资源: 1330
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功