(ctx context.Context, module ExecutionMethod, execIO *ExecutionIO)
| 38 | } |
| 39 | |
| 40 | func ExecuteMethod(ctx context.Context, module ExecutionMethod, execIO *ExecutionIO) (err error) { |
| 41 | log := zerolog.Ctx(ctx) |
| 42 | |
| 43 | if err = module.Connect(ctx); err != nil { |
| 44 | log.Error().Err(err).Msg("Connection failed") |
| 45 | return fmt.Errorf("connect: %w", err) |
| 46 | } |
| 47 | log.Debug().Msg("Module connected") |
| 48 | |
| 49 | if err = module.Init(ctx); err != nil { |
| 50 | log.Error().Err(err).Msg("Module initialization failed") |
| 51 | return fmt.Errorf("init module: %w", err) |
| 52 | } |
| 53 | log.Debug().Msg("Module initialized") |
| 54 | |
| 55 | if err = module.Execute(ctx, execIO); err != nil { |
| 56 | log.Error().Err(err).Msg("Execution failed") |
| 57 | return fmt.Errorf("execute: %w", err) |
| 58 | } |
| 59 | |
| 60 | return |
| 61 | } |
| 62 | |
| 63 | func ExecuteAuxiliaryMethod(ctx context.Context, module AuxiliaryMethod) (err error) { |
| 64 | log := zerolog.Ctx(ctx) |
no test coverage detected
searching dependent graphs…