Welcome to HelloFresh GoEngine!!
GoEngine provides you all the capabilities to build an Event sourced application in go. This was based on the initial project Engine for PHP
Engine is divided in a few small independent components.
go get -u github.com/hellofresh/goengine
Here you can check a small tutorial of how to use this component in an orders scenario.
GoEngine uses default log
package for debug logging. If you want to use your own logger - goengine.SetLogHandler()
is available. Here is how you can use, e.g. github.com/sirupsen/logrus
for logging:
package main
import (
"github.com/hellofresh/goengine"
log "github.com/sirupsen/logrus"
)
func main() {
goengine.SetLogHandler(func(msg string, fields map[string]interface{}, err error) {
if nil == fields && nil == err {
log.Debug(msg)
} else {
var entry *log.Entry
if fields != nil {
entry = log.WithFields(log.Fields(fields))
if nil != err {
entry = entry.WithError(err)
}
} else {
entry = log.WithError(err)
}
entry.Debug(msg)
}
})
// do your application stuff
}
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.