Documentation ¶
Index ¶
Constants ¶
const EventHeaderKey = "X-Event-Key"
EventHeaderKey represents the event type of an incoming webhook from Bitbucket
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitbucketCloudWebhook ¶
type BitbucketCloudWebhook struct {
// contains filtered or unexported fields
}
BitbucketCloudWebhook represents an incoming webhook on Bitbucket cloud
func NewBitbucketCloudWebhookWebhook ¶
func NewBitbucketCloudWebhookWebhook(request *http.Request) *BitbucketCloudWebhook
NewBitbucketCloudWebhookWebhook create a new BitbucketCloudWebhook instance
type BitbucketServerWebhook ¶
type BitbucketServerWebhook struct {
// contains filtered or unexported fields
}
BitbucketServerWebhook represents an incoming webhook on Bitbucket server
func NewBitbucketServerWebhookWebhook ¶
func NewBitbucketServerWebhookWebhook(request *http.Request) *BitbucketServerWebhook
NewBitbucketServerWebhookWebhook create a new BitbucketServerWebhook instance
type GitHubWebhook ¶
type GitHubWebhook struct {
// contains filtered or unexported fields
}
GitHubWebhook represents an incoming webhook on GitHub
func NewGitHubWebhook ¶
func NewGitHubWebhook(request *http.Request) *GitHubWebhook
NewGitHubWebhook create a new GitHubWebhook instance
type GitLabWebhook ¶
type GitLabWebhook struct {
// contains filtered or unexported fields
}
GitLabWebhook represents an incoming webhook on GitLab
func NewGitLabWebhook ¶
func NewGitLabWebhook(request *http.Request) *GitLabWebhook
NewGitLabWebhook create a new GitLabWebhook instance
type WebHookInfoRepoDetails ¶ added in v1.1.0
type WebHookInfoRepoDetails struct { Name string `json:"name,omitempty"` Owner string `json:"owner,omitempty"` }
WebHookInfoRepoDetails represents repository info of an incoming webhook
type WebhookInfo ¶
type WebhookInfo struct { // The target repository for pull requests and push TargetRepositoryDetails WebHookInfoRepoDetails `json:"target_repository_details,omitempty"` // The target branch for pull requests and push TargetBranch string `json:"branch,omitempty"` // Pull request id PullRequestId int `json:"pull_request_id,omitempty"` // The source repository for pull requests SourceRepositoryDetails WebHookInfoRepoDetails `json:"source_repository_details,omitempty"` // The source branch for pull requests SourceBranch string `json:"source_branch,omitempty"` // Seconds from epoch Timestamp int64 `json:"timestamp,omitempty"` // The event type Event vcsutils.WebhookEvent `json:"event,omitempty"` }
WebhookInfo used for parsing an incoming webhook request from the VCS provider.
func ParseIncomingWebhook ¶
func ParseIncomingWebhook(provider vcsutils.VcsProvider, token []byte, request *http.Request) (*WebhookInfo, error)
ParseIncomingWebhook parse incoming webhook payload request into a structurized WebhookInfo object. provider - The VCS provider token - Token to authenticate incoming webhooks. If empty, signature will not be verified. request - The HTTP request of the incoming webhook
type WebhookParser ¶
type WebhookParser interface {
// contains filtered or unexported methods
}
WebhookParser is a webhook parser of an incoming webhook from a VCS server