package plugin type HookType string const ( HookEventAlert HookType = "event_alert" HookMetricAlert HookType = "metric_alert" HookIssue HookType = "issue" HookComment HookType = "comment" ) // isHookEnabled проверяет, включен ли хук для проекта func isHookEnabled(p *LinkedProject, hook HookType) bool { switch hook { case HookEventAlert: return p.Hooks.EventAlert case HookMetricAlert: return p.Hooks.MetricAlert case HookIssue: return p.Hooks.Issue case HookComment: return p.Hooks.Comment default: return false } }