diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
commit | 8eb5120fbd19dac1221f82d84c339b4be9b0975b (patch) | |
tree | 3238704d9968d41f3f871adda4c280e3bd73685d /models/webhook.go | |
parent | 8c9338a5377c60c84cdee1f5781b3de5933bb3b0 (diff) | |
download | gitea-8eb5120fbd19dac1221f82d84c339b4be9b0975b.tar.gz gitea-8eb5120fbd19dac1221f82d84c339b4be9b0975b.zip |
#12, API: list user repos, list repo hooks
Diffstat (limited to 'models/webhook.go')
-rw-r--r-- | models/webhook.go | 20 |
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 ( |