MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / ExecutePreHooks

Method ExecutePreHooks

internal/hooks/manager.go:248–255  ·  view source on GitHub ↗

ExecutePreHooks queues all active pre-transaction hooks for execution. It retrieves all PreTransaction hooks and queues them with the transaction data. Parameters: - ctx: The context for the operation. - transactionID: The ID of the transaction triggering the hooks. - data: The transaction data pay

(ctx context.Context, transactionID string, data interface{})

Source from the content-addressed store, hash-verified

246// Returns:
247// - error: An error if hook retrieval or queuing fails.
248func (m *redisHookManager) ExecutePreHooks(ctx context.Context, transactionID string, data interface{}) error {
249 hooks, err := m.ListHooks(ctx, PreTransaction)
250 if err != nil {
251 return err
252 }
253
254 return m.ExecuteHooks(ctx, hooks, PreTransaction, transactionID, data)
255}
256
257// ExecutePostHooks queues all active post-transaction hooks for execution.
258// It retrieves all PostTransaction hooks and queues them with the transaction data.

Callers

nothing calls this directly

Calls 2

ListHooksMethod · 0.95
ExecuteHooksMethod · 0.95

Tested by

no test coverage detected