MCPcopy Create free account
hub / github.com/FalconOpsLLC/goexec / ExecuteMethod

Function ExecuteMethod

pkg/goexec/method.go:40–61  ·  view source on GitHub ↗
(ctx context.Context, module ExecutionMethod, execIO *ExecutionIO)

Source from the content-addressed store, hash-verified

38}
39
40func 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
63func ExecuteAuxiliaryMethod(ctx context.Context, module AuxiliaryMethod) (err error) {
64 log := zerolog.Ctx(ctx)

Callers 1

ExecuteCleanMethodFunction · 0.85

Calls 3

ConnectMethod · 0.65
InitMethod · 0.65
ExecuteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…