Closed bounoable closed 3 years ago
Add built-in commands for common actions:
command.DeleteAggregate() should delete an aggregate by deleting its events:
command.DeleteAggregate()
package example func delete(aggregateName string, aggregateID uuid.UUID, bus command.Bus) { cmd := command.DeleteAggregate(aggregateName, aggregateID) bus.Dispatch(context.TODO(), cmd) }
package main import "github.com/modernice/goes/command" func main() { var ctx context.Context var bus command.Bus errs, err := command.HandleBuiltin(ctx, bus) if err != nil { log.Fatalf("handle built-in goes commands: %w", err) } for err := range errs { log.Println(fmt.Errorf("handle command: %w", err) } }
Add built-in commands for common actions:
Delete aggregate
command.DeleteAggregate()
should delete an aggregate by deleting its events:Handle built-in commands