|
| 1 | +package webhooks |
| 2 | + |
| 3 | +// GitHubWebhook instance contains all methods needed to process events |
| 4 | +type GitHubWebhook struct { |
| 5 | + provider Provider |
| 6 | +} |
| 7 | + |
| 8 | +// GitHubConfig defines the configuration to create a new GitHubWebhook instance |
| 9 | +type GitHubConfig struct { |
| 10 | + Provider Provider |
| 11 | +} |
| 12 | + |
| 13 | +// GitHubHook defines a GitHub hook type |
| 14 | +type GitHubHook string |
| 15 | + |
| 16 | +// GitHub hook types |
| 17 | +const ( |
| 18 | + Any GitHubHook = "*" |
| 19 | + CommitComment GitHubHook = "commit_comment" |
| 20 | + Create GitHubHook = "create" |
| 21 | + Delete GitHubHook = "delete" |
| 22 | + Deployment GitHubHook = "deployment" |
| 23 | + DeploymentStatus GitHubHook = "deployment_status" |
| 24 | + Fork GitHubHook = "fork" |
| 25 | + Gollum GitHubHook = "gollum" |
| 26 | + IssueComment GitHubHook = "issue_comment" |
| 27 | + Issues GitHubHook = "issues" |
| 28 | + Member GitHubHook = "member" |
| 29 | + Membership GitHubHook = "membership" |
| 30 | + PageBuild GitHubHook = "page_build" |
| 31 | + Public GitHubHook = "public" |
| 32 | + PullRequestReviewComment GitHubHook = "pull_request_review_comment" |
| 33 | + PullRequest GitHubHook = "pull_request" |
| 34 | + Push GitHubHook = "push" |
| 35 | + Repository GitHubHook = "repository" |
| 36 | + Release GitHubHook = "release" |
| 37 | + Status GitHubHook = "status" |
| 38 | + TeamAdd GitHubHook = "team_add" |
| 39 | + Watch GitHubHook = "watch" |
| 40 | +) |
| 41 | + |
| 42 | +// GitHubHookSubtype defines a GitHub Hook subtype |
| 43 | +type GitHubHookSubtype string |
| 44 | + |
| 45 | +// GitHub hook subtypes |
| 46 | +const ( |
| 47 | + Branch GitHubHookSubtype = "branch" |
| 48 | + Tag GitHubHookSubtype = "tag" |
| 49 | + Pull GitHubHookSubtype = "pull" |
| 50 | + Issue GitHubHookSubtype = "issues" |
| 51 | +) |
| 52 | + |
| 53 | +// Provider returns the GitHubWebhook's provider |
| 54 | +func (w GitHubWebhook) Provider() Provider { |
| 55 | + return w.provider |
| 56 | +} |
| 57 | + |
| 58 | +// UnderlyingProvider returns the GitHubConfig's Provider |
| 59 | +func (c GitHubConfig) UnderlyingProvider() Provider { |
| 60 | + return c.Provider |
| 61 | +} |
0 commit comments