mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 07:39:59 +01:00
webhook: add issue comment event
This commit is contained in:
24
vendor/github.com/gogits/go-gogs-client/repo_hook.go
generated
vendored
24
vendor/github.com/gogits/go-gogs-client/repo_hook.go
generated
vendored
@@ -92,7 +92,10 @@ type PayloadCommit struct {
|
||||
var (
|
||||
_ Payloader = &CreatePayload{}
|
||||
_ Payloader = &DeletePayload{}
|
||||
_ Payloader = &ForkPayload{}
|
||||
_ Payloader = &PushPayload{}
|
||||
_ Payloader = &IssuesPayload{}
|
||||
_ Payloader = &IssueCommentPayload{}
|
||||
_ Payloader = &PullRequestPayload{}
|
||||
)
|
||||
|
||||
@@ -266,6 +269,27 @@ func (p *IssuesPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
type HookIssueCommentAction string
|
||||
|
||||
const (
|
||||
HOOK_ISSUE_COMMENT_CREATED HookIssueCommentAction = "created"
|
||||
HOOK_ISSUE_COMMENT_EDITED HookIssueCommentAction = "edited"
|
||||
HOOK_ISSUE_COMMENT_DELETED HookIssueCommentAction = "deleted"
|
||||
)
|
||||
|
||||
type IssueCommentPayload struct {
|
||||
Action HookIssueCommentAction `json:"action"`
|
||||
Issue *Issue `json:"issue"`
|
||||
Comment *Comment `json:"comment"`
|
||||
Changes *ChangesPayload `json:"changes,omitempty"`
|
||||
Repository *Repository `json:"repository"`
|
||||
Sender *User `json:"sender"`
|
||||
}
|
||||
|
||||
func (p *IssueCommentPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
// __________ .__ .__ __________ __
|
||||
// \______ \__ __| | | | \______ \ ____ ________ __ ____ _______/ |_
|
||||
// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
|
||||
|
||||
Reference in New Issue
Block a user