diff options
author | guyzmo <guyzmo+github+pub@m0g.net> | 2017-05-05 04:55:54 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-05 10:55:54 +0800 |
commit | 98460a8d9d9b2bcd31871837ac61d70b153df9c4 (patch) | |
tree | 49a79dc74678e5488e10fc58234288339a77b6f6 /vendor/code.gitea.io/sdk/gitea/hook.go | |
parent | a503947fba7b9cd81bf52305c58f11a4a0d93df5 (diff) | |
download | gitea-98460a8d9d9b2bcd31871837ac61d70b153df9c4.tar.gz gitea-98460a8d9d9b2bcd31871837ac61d70b153df9c4.zip |
Exposes in API the Repo entity's Size and IsBare property (#1668)
* Exposes in API the Repo entity's IsBare property as IsEmpty
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
* Exposes in API the Repo entity's Size property
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
Diffstat (limited to 'vendor/code.gitea.io/sdk/gitea/hook.go')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/hook.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/hook.go b/vendor/code.gitea.io/sdk/gitea/hook.go index 4b45068127..f93a8ba460 100644 --- a/vendor/code.gitea.io/sdk/gitea/hook.go +++ b/vendor/code.gitea.io/sdk/gitea/hook.go @@ -353,3 +353,39 @@ func (p *PullRequestPayload) SetSecret(secret string) { func (p *PullRequestPayload) JSONPayload() ([]byte, error) { return json.MarshalIndent(p, "", " ") } + +//__________ .__ __ +//\______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__. +// | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | | +// | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ | +// |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____| +// \/ \/|__| \/ \/ + +// HookRepoAction an action that happens to a repo +type HookRepoAction string + +const ( + // HookRepoCreated created + HookRepoCreated HookRepoAction = "created" + // HookRepoDeleted deleted + HookRepoDeleted HookRepoAction = "deleted" +) + +// RepositoryPayload payload for repository webhooks +type RepositoryPayload struct { + Secret string `json:"secret"` + Action HookRepoAction `json:"action"` + Repository *Repository `json:"repository"` + Organization *User `json:"organization"` + Sender *User `json:"sender"` +} + +// SetSecret set the payload's secret +func (p *RepositoryPayload) SetSecret(secret string) { + p.Secret = secret +} + +// JSONPayload JSON representation of the payload +func (p *RepositoryPayload) JSONPayload() ([]byte, error) { + return json.MarshalIndent(p, "", " ") +} |