(ctx context.Context, pf progressFunc, operation string, bus api.EventProcessor)
| 26 | type progressFunc func(context.Context) error |
| 27 | |
| 28 | func Run(ctx context.Context, pf progressFunc, operation string, bus api.EventProcessor) error { |
| 29 | bus.Start(ctx, operation) |
| 30 | err := pf(ctx) |
| 31 | bus.Done(operation, err != nil) |
| 32 | return err |
| 33 | } |
| 34 | |
| 35 | // errorEvent creates a new Error Resource with message |
| 36 | func errorEvent(id string, msg string) api.Resource { |