diff options
author | Unknwon <u@gogs.io> | 2017-02-24 15:35:20 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-27 22:47:21 -0500 |
commit | f0086e66aef31573c7f00e0c3cd7725fb6d65f5c (patch) | |
tree | 865fd5787c6f714add7be9da1e8cf19d4bc887cc /vendor/github.com/gogits | |
parent | 7fe13e72d8f8c0e61abbc4068ecb965347fe0331 (diff) |
webhook: able to detect delete branch or tag (#2315)
Diffstat (limited to 'vendor/github.com/gogits')
-rw-r--r-- | vendor/github.com/gogits/go-gogs-client/gogs.go | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/go-gogs-client/repo_hook.go | 35 |
2 files changed, 32 insertions, 5 deletions
diff --git a/vendor/github.com/gogits/go-gogs-client/gogs.go b/vendor/github.com/gogits/go-gogs-client/gogs.go index dae81f10..98421cb7 100644 --- a/vendor/github.com/gogits/go-gogs-client/gogs.go +++ b/vendor/github.com/gogits/go-gogs-client/gogs.go @@ -14,7 +14,7 @@ import ( ) func Version() string { - return "0.12.6" + return "0.12.7" } // Client represents a Gogs API client. diff --git a/vendor/github.com/gogits/go-gogs-client/repo_hook.go b/vendor/github.com/gogits/go-gogs-client/repo_hook.go index 6597be5e..49c4a5f7 100644 --- a/vendor/github.com/gogits/go-gogs-client/repo_hook.go +++ b/vendor/github.com/gogits/go-gogs-client/repo_hook.go @@ -91,6 +91,7 @@ type PayloadCommit struct { var ( _ Payloader = &CreatePayload{} + _ Payloader = &DeletePayload{} _ Payloader = &PushPayload{} _ Payloader = &PullRequestPayload{} ) @@ -103,10 +104,11 @@ var ( // \/ \/ \/ \/ type CreatePayload struct { - Ref string `json:"ref"` - RefType string `json:"ref_type"` - Repo *Repository `json:"repository"` - Sender *User `json:"sender"` + Ref string `json:"ref"` + RefType string `json:"ref_type"` + DefaultBranch string `json:"default_branch"` + Repo *Repository `json:"repository"` + Sender *User `json:"sender"` } func (p *CreatePayload) JSONPayload() ([]byte, error) { @@ -133,6 +135,31 @@ func ParseCreateHook(raw []byte) (*CreatePayload, error) { return hook, nil } +// ________ .__ __ +// \______ \ ____ | | _____/ |_ ____ +// | | \_/ __ \| | _/ __ \ __\/ __ \ +// | ` \ ___/| |_\ ___/| | \ ___/ +// /_______ /\___ >____/\___ >__| \___ > +// \/ \/ \/ \/ + +type PusherType string + +const ( + PUSHER_TYPE_USER PusherType = "user" +) + +type DeletePayload struct { + Ref string `json:"ref"` + RefType string `json:"ref_type"` + PusherType PusherType `json:"pusher_type"` + Repo *Repository `json:"repository"` + Sender *User `json:"sender"` +} + +func (p *DeletePayload) JSONPayload() ([]byte, error) { + return json.MarshalIndent(p, "", " ") +} + // __________ .__ // \______ \__ __ _____| |__ // | ___/ | \/ ___/ | \ |