aboutsummaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/models/webhook.go b/models/webhook.go
index ac0c240977..3ee517cada 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -27,6 +27,16 @@ const (
FORM
)
+func (t HookContentType) Name() string {
+ switch t {
+ case JSON:
+ return "json"
+ case FORM:
+ return "form"
+ }
+ return ""
+}
+
// HookEvent represents events that will delivery hook.
type HookEvent struct {
PushOnly bool `json:"push_only"`
@@ -147,6 +157,16 @@ const (
SLACK
)
+func (t HookTaskType) Name() string {
+ switch t {
+ case GOGS:
+ return "gogs"
+ case SLACK:
+ return "slack"
+ }
+ return ""
+}
+
type HookEventType string
const (