Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
go-gitee
提交
41087976
G
go-gitee
项目概览
openeuler
/
go-gitee
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-gitee
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
41087976
编写于
3月 16, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
3月 16, 2020
浏览文件
操作
浏览文件
下载
差异文件
!15 Define dedicated models for webhook events
Merge pull request !15 from imjoey/fix_error_webhook_response
上级
ce7dbc91
d301231f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
222 addition
and
77 deletion
+222
-77
gitee/hook_event_models.go
gitee/hook_event_models.go
+170
-25
gitee/hook_event_types.go
gitee/hook_event_types.go
+52
-52
未找到文件。
gitee/hook_event_models.go
浏览文件 @
41087976
package
gitee
import
"time"
// See https://gitee.com/help/articles/4271 for the details of all
// the webhook modles.
// LabelHook : 标签, issue 和 pull request 的对应标签
type
LabelHook
struct
{
Id
int32
`json:"id,omitempty"`
Name
string
`json:"name,omitempty"`
Color
string
`json:"color,omitempty"`
}
// EnterpriseHook : 企业信息
type
EnterpriseHook
struct
{
Name
string
`json:"name,omitempty"`
Url
string
`json:"url,omitempty"`
}
// NoteHook : 评论信息
type
NoteHook
struct
{
Id
int32
`json:"id,omitempty"`
Body
string
`json:"body,omitempty"`
User
*
UserHook
`json:"user,omitempty"`
CreatedAt
string
`json:"created_at,omitempty"`
UpdatedAt
string
`json:"updated_at,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Position
string
`json:"position,omitempty"`
CommitId
string
`json:"commit_id,omitempty"`
}
// UserHook : 用户信息
type
UserHook
struct
{
Id
int32
`json:"id,omitempty"`
Name
string
`json:"name,omitempty"`
Email
string
`json:"email,omitempty"`
Username
string
`json:"username,omitempty"`
UserName
string
`json:"user_name,omitempty"`
Url
string
`json:"url,omitempty"`
Login
string
`json:"login,omitempty"`
AvatarUrl
string
`json:"avatar_url,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Type_
string
`json:"type,omitempty"`
SiteAdmin
bool
`json:"site_admin,omitempty"`
Time
time
.
Time
`json:"time,omitempty"`
Remark
string
`json:"remark,omitempty"`
}
// CommitHook : git commit 中的信息
type
CommitHook
struct
{
Id
string
`json:"id,omitempty"`
TreeId
string
`json:"tree_id,omitempty"`
ParentIds
[]
string
`json:"parent_ids,omitempty"`
Message
string
`json:"message,omitempty"`
Timestamp
time
.
Time
`json:"timestamp,omitempty"`
Url
string
`json:"url,omitempty"`
Author
*
UserHook
`json:"author,omitempty"`
Committer
*
UserHook
`json:"committer,omitempty"`
Distinct
bool
`json:"distinct,omitempty"`
Added
[]
string
`json:"added,omitempty"`
Removed
[]
string
`json:"removed,omitempty"`
Modified
[]
string
`json:"modified,omitempty"`
}
// MilestoneHook : 里程碑信息
type
MilestoneHook
struct
{
Id
string
`json:"id,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Number
int32
`json:"number,omitempty"`
Title
string
`json:"title,omitempty"`
Description
string
`json:"description,omitempty"`
OpenIssues
int32
`json:"open_issues,omitempty"`
ClosedIssues
int32
`json:"closed_issues,omitempty"`
State
string
`json:"state,omitempty"`
CreatedAt
time
.
Time
`json:"created_at,omitempty"`
UpdatedAt
time
.
Time
`json:"updated_at,omitempty"`
DueOn
string
`json:"due_on,omitempty"`
}
// IssueHook : issue 信息
type
IssueHook
struct
{
Id
int32
`json:"id,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Number
string
`json:"number,omitempty"`
Title
string
`json:"title,omitempty"`
User
*
UserHook
`json:"user,omitempty"`
Labels
[]
LabelHook
`json:"labels,omitempty"`
State
string
`json:"state,omitempty"`
StateName
string
`json:"state_name,omitempty"`
TypeName
string
`json:"type_name,omitempty"`
Assignee
*
UserHook
`json:"assignee,omitempty"`
Collaborators
[]
UserHook
`json:"collaborators,omitempty"`
Milestone
*
MilestoneHook
`json:"milestone,omitempty"`
Comments
int32
`json:"comments,omitempty"`
CreatedAt
time
.
Time
`json:"created_at,omitempty"`
UpdatedAt
time
.
Time
`json:"updated_at,omitempty"`
Body
string
`json:"body,omitempty"`
}
// ProjectHook : project 信息
type
ProjectHook
struct
{
Id
int32
`json:"id,omitempty"`
Name
string
`json:"name,omitempty"`
Path
string
`json:"path,omitempty"`
FullName
string
`json:"full_name,omitempty"`
Owner
*
User
Basic
`json:"owner,omitempty"`
Private
bool
`json:"private,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Url
string
`json:"url,omitempty"`
Description
string
`json:"description,omitempty"`
Fork
bool
`json:"fork,omitempty"`
PushedAt
string
`json:"pushed_at,omitempty"`
CreatedAt
string
`json:"created_at,omitempty"`
UpdatedAt
string
`json:"updated_at,omitempty"`
SshUrl
string
`json:"ssh_url,omitempty"`
GitUrl
string
`json:"git_url,omitempty"`
CloneUrl
string
`json:"clone_url,omitempty"`
SvnUrl
string
`json:"svn_url,omitempty"`
GitHttpUrl
string
`json:"git_http_url,omitempty"`
GitSshUrl
string
`json:"git_ssh_url,omitempty"`
GitSvnUrl
string
`json:"git_svn_url,omitempty"`
Homepage
string
`json:"homepage,omitempty"`
StargazersCount
int32
`json:"stargazers_count,omitempty"`
WatchersCount
int32
`json:"watchers_count,omitempty"`
ForksCount
int32
`json:"forks_count,omitempty"`
Language
string
`json:"language,omitempty"`
Id
int32
`json:"id,omitempty"`
Name
string
`json:"name,omitempty"`
Path
string
`json:"path,omitempty"`
FullName
string
`json:"full_name,omitempty"`
Owner
*
User
Hook
`json:"owner,omitempty"`
Private
bool
`json:"private,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
Url
string
`json:"url,omitempty"`
Description
string
`json:"description,omitempty"`
Fork
bool
`json:"fork,omitempty"`
PushedAt
string
`json:"pushed_at,omitempty"`
CreatedAt
string
`json:"created_at,omitempty"`
UpdatedAt
string
`json:"updated_at,omitempty"`
SshUrl
string
`json:"ssh_url,omitempty"`
GitUrl
string
`json:"git_url,omitempty"`
CloneUrl
string
`json:"clone_url,omitempty"`
SvnUrl
string
`json:"svn_url,omitempty"`
GitHttpUrl
string
`json:"git_http_url,omitempty"`
GitSshUrl
string
`json:"git_ssh_url,omitempty"`
GitSvnUrl
string
`json:"git_svn_url,omitempty"`
Homepage
string
`json:"homepage,omitempty"`
StargazersCount
int32
`json:"stargazers_count,omitempty"`
WatchersCount
int32
`json:"watchers_count,omitempty"`
ForksCount
int32
`json:"forks_count,omitempty"`
Language
string
`json:"language,omitempty"`
HasIssues
bool
`json:"has_issues,omitempty"`
HasWiki
bool
`json:"has_wiki,omitempty"`
...
...
@@ -39,3 +138,49 @@ type ProjectHook struct {
NameWithNamespace
string
`json:"name_with_namespace,omitempty"`
PathWithNamespace
string
`json:"path_with_namespace,omitempty"`
}
// BranchHook : 分支信息
type
BranchHook
struct
{
Label
string
`json:"label,omitempty"`
Ref
string
`json:"ref,omitempty"`
Sha
string
`json:"sha,omitempty"`
User
*
UserHook
`json:"user,omitempty"`
Repo
*
ProjectHook
`json:"repo,omitempty"`
}
// PullRequestHook : PR 信息
type
PullRequestHook
struct
{
Id
int32
`json:"id,omitempty"`
Number
int32
`json:"number,omitempty"`
State
string
`json:"state,omitempty"`
HtmlUrl
string
`json:"html_url,omitempty"`
DiffUrl
string
`json:"diff_url,omitempty"`
PatchUrl
string
`json:"patch_url,omitempty"`
Title
string
`json:"title,omitempty"`
Body
string
`json:"body,omitempty"`
CreatedAt
string
`json:"created_at,omitempty"`
UpdatedAt
string
`json:"updated_at,omitempty"`
ClosedAt
string
`json:"closed_at,omitempty"`
MergedAt
string
`json:"merged_at,omitempty"`
MergeCommitSha
string
`json:"merge_commit_sha,omitempty"`
MergeReferenceName
string
`json:"merge_reference_name,omitempty"`
User
*
UserHook
`json:"user,omitempty"`
Assignee
*
UserHook
`json:"assignee,omitempty"`
Assignees
[]
UserHook
`json:"assignees,omitempty"`
Tester
[]
UserHook
`json:"tester,omitempty"`
Testers
[]
UserHook
`json:"testers,omitempty"`
NeedTest
bool
`json:"need_test,omitempty"`
need_review
bool
`json:"need_review,omitempty"`
Milestone
*
MilestoneHook
`json:"milestone,omitempty"`
Head
*
BranchHook
`json:"head,omitempty"`
Base
*
BranchHook
`json:"base,omitempty"`
Merged
bool
`json:"merged,omitempty"`
Mergeable
bool
`json:"mergeable,omitempty"`
merge_status
string
`json:"merge_status,omitempty"`
UpdatedBy
*
UserHook
`json:"updated_by,omitempty"`
Comments
int32
`json:"comments,omitempty"`
Commits
int32
`json:"commits,omitempty"`
Additions
int32
`json:"additions,omitempty"`
Deletions
int32
`json:"deletions,omitempty"`
ChangedFiles
int32
`json:"changed_files,omitempty"`
}
gitee/hook_event_types.go
浏览文件 @
41087976
...
...
@@ -2,11 +2,11 @@ package gitee
type
NoteEvent
struct
{
Action
*
string
`json:"action,omitempty"`
Comment
*
Note
`json:"comment,omitempty"`
Comment
*
Note
Hook
`json:"comment,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
Author
*
User
`json:"author,omitempty"`
Sender
*
User
`json:"sender,omitempty"`
Author
*
User
Hook
`json:"author,omitempty"`
Sender
*
User
Hook
`json:"sender,omitempty"`
URL
*
string
`json:"url,omitempty"`
Note
*
string
`json:"note,omitempty"`
NoteableType
*
string
`json:"noteable_type,omitempty"`
...
...
@@ -14,55 +14,55 @@ type NoteEvent struct {
Title
*
string
`json:"title,omitempty"`
PerIID
*
string
`json:"per_iid,omitempty"`
ShortCommitID
*
string
`json:"short_commit_id,omitempty"`
Enterprise
*
Enterprise
Basic
`json:"enterprise,omitempty"`
PullRequest
*
PullRequest
`json:"pull_request,omitempty"`
Issue
*
Issue
`json:"issue,omitempty"`
Enterprise
*
Enterprise
Hook
`json:"enterprise,omitempty"`
PullRequest
*
PullRequest
Hook
`json:"pull_request,omitempty"`
Issue
*
Issue
Hook
`json:"issue,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
}
type
PushEvent
struct
{
Ref
*
string
`json:"ref,omitempty"`
Before
*
string
`json:"before,omitempty"`
After
*
string
`json:"after,omitempty"`
TotalCommitsCount
int64
`json:"total_commits_count,omitempty"`
CommitsMoreThanTen
*
bool
`json:"commits_more_than_ten,omitempty"`
Created
*
bool
`json:"created,omitempty"`
Deleted
*
bool
`json:"deleted,omitempty"`
Compare
*
string
`json:"compare,omitempty"`
Commits
[]
Commit
`json:"commits,omitempty"`
HeadCommit
*
Commit
`json:"head_commit,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
UserID
int64
`json:"user_id,omitempty"`
UserName
*
string
`json:"user_name,omitempty"`
User
*
User
`json:"user,omitempty"`
Pusher
*
User
`json:"pusher,omitempty"`
Sender
*
User
`json:"sender,omitempty"`
Enterprise
*
Enterprise
Basic
`json:"enterprise,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
Ref
*
string
`json:"ref,omitempty"`
Before
*
string
`json:"before,omitempty"`
After
*
string
`json:"after,omitempty"`
TotalCommitsCount
int64
`json:"total_commits_count,omitempty"`
CommitsMoreThanTen
*
bool
`json:"commits_more_than_ten,omitempty"`
Created
*
bool
`json:"created,omitempty"`
Deleted
*
bool
`json:"deleted,omitempty"`
Compare
*
string
`json:"compare,omitempty"`
Commits
[]
Commit
Hook
`json:"commits,omitempty"`
HeadCommit
*
Commit
Hook
`json:"head_commit,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
UserID
int64
`json:"user_id,omitempty"`
UserName
*
string
`json:"user_name,omitempty"`
User
*
User
Hook
`json:"user,omitempty"`
Pusher
*
User
Hook
`json:"pusher,omitempty"`
Sender
*
User
Hook
`json:"sender,omitempty"`
Enterprise
*
Enterprise
Hook
`json:"enterprise,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
}
type
IssueEvent
struct
{
Action
*
string
`json:"action,omitempty"`
Issue
*
Issue
`json:"issue,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
Sender
*
User
`json:"sender,omitempty"`
TargetUser
*
User
`json:"target_user,omitempty"`
User
*
User
`json:"user,omitempty"`
Assignee
*
User
Basic
`json:"assignee,omitempty"`
UpdatedBy
*
User
`json:"updated_by,omitempty"`
IID
string
`json:"iid,omitempty"`
Title
*
string
`json:"title,omitempty"`
Description
*
string
`json:"description,omitempty"`
State
*
string
`json:"state,omitempty"`
Milestone
*
Milestone
`json:"milestone,omitempty"`
URL
*
string
`json:"url,omitempty"`
Enterprise
*
Enterprise
Basic
`json:"enterprise,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
Action
*
string
`json:"action,omitempty"`
Issue
*
Issue
Hook
`json:"issue,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
Sender
*
User
Hook
`json:"sender,omitempty"`
TargetUser
*
User
Hook
`json:"target_user,omitempty"`
User
*
User
Hook
`json:"user,omitempty"`
Assignee
*
User
Hook
`json:"assignee,omitempty"`
UpdatedBy
*
User
Hook
`json:"updated_by,omitempty"`
IID
string
`json:"iid,omitempty"`
Title
*
string
`json:"title,omitempty"`
Description
*
string
`json:"description,omitempty"`
State
*
string
`json:"state,omitempty"`
Milestone
*
Milestone
Hook
`json:"milestone,omitempty"`
URL
*
string
`json:"url,omitempty"`
Enterprise
*
Enterprise
Hook
`json:"enterprise,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
}
type
RepoInfo
struct
{
...
...
@@ -72,7 +72,7 @@ type RepoInfo struct {
type
PullRequestEvent
struct
{
Action
*
string
`json:"action,omitempty"`
PullRequest
*
PullRequest
`json:"pull_request,omitempty"`
PullRequest
*
PullRequest
Hook
`json:"pull_request,omitempty"`
Number
int64
`json:"number,omitempty"`
IID
int64
`json:"iid,omitempty"`
Title
*
string
`json:"title,omitempty"`
...
...
@@ -82,16 +82,16 @@ type PullRequestEvent struct {
MergeCommitSha
*
string
`json:"merge_commit_sha,omitempty"`
URL
*
string
`json:"url,omitempty"`
SourceBranch
*
string
`json:"source_branch,omitempty"`
SourceRepo
*
RepoInfo
`json:"source_repo,omitempty"`
SourceRepo
*
ProjectHook
`json:"source_repo,omitempty"`
TargetBranch
*
string
`json:"target_branch,omitempty"`
TargetRepo
*
RepoInfo
`json:"target_repo,omitempty"`
TargetRepo
*
ProjectHook
`json:"target_repo,omitempty"`
Project
*
ProjectHook
`json:"project,omitempty"`
Repository
*
ProjectHook
`json:"repository,omitempty"`
Author
*
User
`json:"author,omitempty"`
UpdatedBy
*
User
`json:"updated_by,omitempty"`
Sender
*
User
`json:"sender,omitempty"`
TargetUser
*
User
`json:"target_user,omitempty"`
Enterprise
*
Enterprise
Basic
`json:"enterprise,omitempty"`
Author
*
User
Hook
`json:"author,omitempty"`
UpdatedBy
*
User
Hook
`json:"updated_by,omitempty"`
Sender
*
User
Hook
`json:"sender,omitempty"`
TargetUser
*
User
Hook
`json:"target_user,omitempty"`
Enterprise
*
Enterprise
Hook
`json:"enterprise,omitempty"`
HookName
*
string
`json:"hook_name,omitempty"`
Password
*
string
`json:"password,omitempty"`
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录