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

Function NewHookManager

internal/hooks/manager.go:54–64  ·  view source on GitHub ↗

NewHookManager creates a new Redis-based hook manager. It initializes the hook manager with the provided Redis client and Asynq client. Parameters: - redisClient: The Redis client for storing hook configurations. - queue: The Asynq client for queuing hook execution tasks. Returns: - HookManager: A

(redisClient redis.UniversalClient, queue *asynq.Client)

Source from the content-addressed store, hash-verified

52// Returns:
53// - HookManager: A new instance of the hook manager.
54func NewHookManager(redisClient redis.UniversalClient, queue *asynq.Client) HookManager {
55 config, err := config.Fetch()
56 if err != nil {
57 logrus.Errorf("failed to fetch config: %v", err)
58 }
59 return &redisHookManager{
60 client: redisClient,
61 queue: queue,
62 config: config,
63 }
64}
65
66// RegisterHook registers a new webhook in Redis.
67// It assigns a new ID if not provided, validates the hook configuration,

Callers 1

NewLedgerForgeFunction · 0.92

Calls 1

FetchFunction · 0.92

Tested by

no test coverage detected