Documentation
¶
Index ¶
- Variables
- type Comment
- type Date
- type DiagnosticsPingPayload
- type Event
- type Option
- type Project
- type PullRequest
- type PullRequestCommentAddedPayload
- type PullRequestCommentDeletedPayload
- type PullRequestCommentEditedPayload
- type PullRequestDeclinedPayload
- type PullRequestDeletedPayload
- type PullRequestMergedPayload
- type PullRequestModifiedPayload
- type PullRequestOpenedPayload
- type PullRequestParticipant
- type PullRequestReviewerApprovedPayload
- type PullRequestReviewerNeedsWorkPayload
- type PullRequestReviewerUnapprovedPayload
- type PullRequestReviewerUpdatedPayload
- type Repository
- type RepositoryChange
- type RepositoryCommentAddedPayload
- type RepositoryCommentDeletedPayload
- type RepositoryCommentEditedPayload
- type RepositoryForkedPayload
- type RepositoryModifiedPayload
- type RepositoryReference
- type RepositoryReferenceChangedPayload
- type User
- type Webhook
- type WebhookOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse") ErrInvalidHTTPMethod = errors.New("invalid HTTP Method") ErrMissingEventKeyHeader = errors.New("missing X-Event-Key Header") ErrMissingHubSignatureHeader = errors.New("missing X-Hub-Signature Header") ErrEventNotFound = errors.New("event not defined to be parsed") ErrParsingPayload = errors.New("error parsing payload") ErrHMACVerificationFailed = errors.New("HMAC verification failed") )
View Source
var Options = WebhookOptions{}
Options is a namespace var for configuration options
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct {
ID uint64 `json:"id"`
Properties map[string]interface{} `json:"properties,omitempty"`
Version uint64 `json:"version"`
Text string `json:"text"`
Author User `json:"author"`
CreatedDate uint64 `json:"createdDate"`
UpdatedDate uint64 `json:"updatedDate"`
Comments []map[string]interface{} `json:"comments"`
Tasks []map[string]interface{} `json:"tasks"`
PermittedOperations map[string]interface{} `json:"permittedOperations,omitempty"`
}
type DiagnosticsPingPayload ¶
type DiagnosticsPingPayload struct{}
type Event ¶
type Event string
const ( RepositoryReferenceChangedEvent Event = "repo:refs_changed" RepositoryModifiedEvent Event = "repo:modified" RepositoryForkedEvent Event = "repo:forked" RepositoryCommentAddedEvent Event = "repo:comment:added" RepositoryCommentEditedEvent Event = "repo:comment:edited" RepositoryCommentDeletedEvent Event = "repo:comment:deleted" PullRequestOpenedEvent Event = "pr:opened" PullRequestModifiedEvent Event = "pr:modified" PullRequestMergedEvent Event = "pr:merged" PullRequestDeclinedEvent Event = "pr:declined" PullRequestDeletedEvent Event = "pr:deleted" PullRequestReviewerUpdatedEvent Event = "pr:reviewer:updated" PullRequestReviewerApprovedEvent Event = "pr:reviewer:approved" PullRequestReviewerUnapprovedEvent Event = "pr:reviewer:unapproved" PullRequestReviewerNeedsWorkEvent Event = "pr:reviewer:needs_work" PullRequestCommentAddedEvent Event = "pr:comment:added" PullRequestCommentEditedEvent Event = "pr:comment:edited" PullRequestCommentDeletedEvent Event = "pr:comment:deleted" DiagnosticsPingEvent Event = "diagnostics:ping" )
type PullRequest ¶
type PullRequest struct {
ID uint64 `json:"id"`
Version uint64 `json:"version"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
State string `json:"state"`
Open bool `json:"open"`
Closed bool `json:"closed"`
CreatedDate uint64 `json:"createdDate"`
UpdatedDate uint64 `json:"updatedDate,omitempty"`
ClosedDate uint64 `json:"closedDate,omitempty"`
FromRef RepositoryReference `json:"fromRef"`
ToRef RepositoryReference `json:"toRef"`
Locked bool `json:"locked"`
Author PullRequestParticipant `json:"author"`
Reviewers []PullRequestParticipant `json:"reviewers"`
Participants []PullRequestParticipant `json:"participants"`
Properties map[string]interface{} `json:"properties,omitempty"`
Links map[string]interface{} `json:"links"`
}
type PullRequestCommentEditedPayload ¶
type PullRequestCommentEditedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
Comment Comment `json:"comment"`
CommentParentId string `json:"commentParentId,omitempty"`
PreviousComment string `json:"previousComment"`
}
type PullRequestDeclinedPayload ¶
type PullRequestDeclinedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
}
type PullRequestDeletedPayload ¶
type PullRequestDeletedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
}
type PullRequestMergedPayload ¶
type PullRequestMergedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
}
type PullRequestModifiedPayload ¶
type PullRequestModifiedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
PreviousTitle string `json:"previousTitle"`
PreviousDescription string `json:"previousDescription"`
PreviousTarget map[string]interface{} `json:"previousTarget"`
}
type PullRequestOpenedPayload ¶
type PullRequestOpenedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
}
type PullRequestParticipant ¶
type PullRequestReviewerApprovedPayload ¶
type PullRequestReviewerApprovedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
Participant PullRequestParticipant `json:"participant"`
PreviousStatus string `json:"previousStatus"`
}
type PullRequestReviewerNeedsWorkPayload ¶
type PullRequestReviewerNeedsWorkPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
Participant PullRequestParticipant `json:"participant"`
PreviousStatus string `json:"previousStatus"`
}
type PullRequestReviewerUnapprovedPayload ¶
type PullRequestReviewerUnapprovedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
PullRequest PullRequest `json:"pullRequest"`
Participant PullRequestParticipant `json:"participant"`
PreviousStatus string `json:"previousStatus"`
}
type Repository ¶
type Repository struct {
ID uint64 `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
ScmId string `json:"scmId"`
State string `json:"state"`
StatusMessage string `json:"statusMessage"`
Forkable bool `json:"forkable"`
Origin *Repository `json:"origin,omitempty"`
Project Project `json:"project"`
Public bool `json:"public"`
Links map[string]interface{} `json:"links"`
}
type RepositoryChange ¶
type RepositoryChange struct {
Reference RepositoryReference `json:"ref"`
ReferenceId string `json:"refId"`
FromHash string `json:"fromHash"`
ToHash string `json:"toHash"`
Type string `json:"type"`
}
type RepositoryForkedPayload ¶
type RepositoryForkedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
Repository Repository `json:"repository"`
}
type RepositoryModifiedPayload ¶
type RepositoryModifiedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
Old Repository `json:"old"`
New Repository `json:"new"`
}
type RepositoryReference ¶
type RepositoryReference struct {
ID string `json:"id"`
DisplayId string `json:"displayId"`
Type string `json:"type,omitempty"`
LatestCommit string `json:"latestCommit,omitempty"`
Repository Repository `json:"repository,omitempty"`
}
type RepositoryReferenceChangedPayload ¶
type RepositoryReferenceChangedPayload struct {
Date Date `json:"date"`
EventKey Event `json:"eventKey"`
Actor User `json:"actor"`
Repository Repository `json:"repository"`
Changes []RepositoryChange `json:"changes"`
}
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
Webhook instance contains all methods needed to process events
type WebhookOptions ¶
type WebhookOptions struct{}
WebhookOptions is a namespace for configuration option methods
func (WebhookOptions) Secret ¶
func (WebhookOptions) Secret(secret string) Option
Secret registers the GitHub secret
Click to show internal directories.
Click to hide internal directories.