/mediatr

WIP: Reflect based mediator for CQRS

Primary LanguageGoMIT LicenseMIT

Go codecov Go Report Card

Command handler without return values
err := mediator.Register(func(command FooEvent){
    return nil
})
Command handler can return error
err := mediator.Register(func(command FooEvent) error{
    return errors.New("db error")
})
Command handler can return error and result(any type)
err := mediator.Register(func(command FooEvent) (string,error){
    return "command executed", nil
})