Skip to content

Commit 8e43847

Browse files
committed
repo_hook: add IssueCommentPayload
1 parent 559fec5 commit 8e43847

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

gogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func Version() string {
17-
return "0.12.8"
17+
return "0.12.9"
1818
}
1919

2020
// Client represents a Gogs API client.

repo_hook.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ type PayloadCommit struct {
9292
var (
9393
_ Payloader = &CreatePayload{}
9494
_ Payloader = &DeletePayload{}
95+
_ Payloader = &ForkPayload{}
9596
_ Payloader = &PushPayload{}
97+
_ Payloader = &IssuesPayload{}
98+
_ Payloader = &IssueCommentPayload{}
9699
_ Payloader = &PullRequestPayload{}
97100
)
98101

@@ -266,6 +269,27 @@ func (p *IssuesPayload) JSONPayload() ([]byte, error) {
266269
return json.MarshalIndent(p, "", " ")
267270
}
268271

272+
type HookIssueCommentAction string
273+
274+
const (
275+
HOOK_ISSUE_COMMENT_CREATED HookIssueCommentAction = "created"
276+
HOOK_ISSUE_COMMENT_EDITED HookIssueCommentAction = "edited"
277+
HOOK_ISSUE_COMMENT_DELETED HookIssueCommentAction = "deleted"
278+
)
279+
280+
type IssueCommentPayload struct {
281+
Action HookIssueCommentAction `json:"action"`
282+
Issue *Issue `json:"issue"`
283+
Comment *Comment `json:"comment"`
284+
Changes *ChangesPayload `json:"changes,omitempty"`
285+
Repository *Repository `json:"repository"`
286+
Sender *User `json:"sender"`
287+
}
288+
289+
func (p *IssueCommentPayload) JSONPayload() ([]byte, error) {
290+
return json.MarshalIndent(p, "", " ")
291+
}
292+
269293
// __________ .__ .__ __________ __
270294
// \______ \__ __| | | | \______ \ ____ ________ __ ____ _______/ |_
271295
// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\

0 commit comments

Comments
 (0)