diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-05 20:52:25 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-05 20:52:25 -0400 |
commit | 24f614f6db13e5c6720efa518641ffcdcb0d8947 (patch) | |
tree | 523d1d93079bed85b75859b51bff408797ed4aae /modules/auth | |
parent | cb505b22ec5133ffe3263f3857fdcd64fa64260b (diff) | |
download | gitea-24f614f6db13e5c6720efa518641ffcdcb0d8947.tar.gz gitea-24f614f6db13e5c6720efa518641ffcdcb0d8947.zip |
Finish add web hook
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/repo.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/auth/repo.go b/modules/auth/repo.go index 54fa99c83d..37b9f1d1e6 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -83,3 +83,24 @@ func (f *RepoSettingForm) Validate(errors *binding.BindingErrors, req *http.Requ data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) validate(errors, data, f) } + +type NewWebhookForm struct { + Url string `form:"url" binding:"Required;Url"` + ContentType string `form:"content_type" binding:"Required"` + Secret string `form:"secret""` + PushOnly bool `form:"push_only"` + Active bool `form:"active"` +} + +func (f *NewWebhookForm) Name(field string) string { + names := map[string]string{ + "Url": "Payload URL", + "ContentType": "Content type", + } + return names[field] +} + +func (f *NewWebhookForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) { + data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errors, data, f) +} |