-
Notifications
You must be signed in to change notification settings - Fork 255
Description
Right now, hooks are created with parameters specified by HookInput
, which contains a HookEvents
to indicate which abstract event should be listened to. But the Hook
struct returned by FindHook()
contains Events []string
, which is a list of native event names. This makes it hard to implement a "reconciliation" logic, where the program needs to check if an existing webhook matches a HookInput
to decide if it should recreate the webhook. The workaround is to only use HookInput.NativeEvents
and don't rely on HookInput.Events
at all.
It seems reasonable to change Hook.Events
from []string
to HookEvents
, and introduce a HookEvents.NativeEvents
field to make the API more consistent. However, these are all breaking changes.
Would it make sense to deprecate HookInput.Events
, HookInput.NativeEvents
and Hook.Events
, and instead having a new field name for HookEvents
in both HookInput
and Hook
?