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)
| 52 | // Returns: |
| 53 | // - HookManager: A new instance of the hook manager. |
| 54 | func 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, |
no test coverage detected