This package is a demonstration of a possible implementation of the Saga Pattern for my public speech. The package is structured in the following way:
command
: package that contains a command structure and constantsexample
: usage example with simple Hotel Booking Sagalog
: package that contains kafka implementation of command logdocker-compose.yaml
: a docker-compose file that can be used to run the example (it has kafka)saga.go
: contains a Saga structurebuilder.go
: contains a Builder struct that allows you to define a Saga by chaining the transactions and compensationssec.go
: contains the implementation of the Saga Execution Coordinator (SEC). The SEC coordinates the execution of sagas by invoking the appropriate commands and compensations, based on the outcome of each transaction.
To use this package, import it into your Golang project and follow the example from the example
folder.
go get github.com/mrfeathers/go-saga
This package is released under the MIT License. See the LICENSE file for more information.