Documentation
¶
Index ¶
- func Debug(server *WebHook)
- func WithAllEventTypes(server *WebHook)
- func WithEventTypes(eventTypes ...string) func(*WebHook)
- func WithPath(path string) func(*WebHook)
- func WithPort(port int) func(*WebHook)
- func WithSecret(secret string) func(*WebHook)
- type ContentReference
- type ContentReferenceEvent
- func (c *ContentReferenceEvent) GetAction() string
- func (c *ContentReferenceEvent) GetContentReference() *ContentReference
- func (c *ContentReferenceEvent) GetInstallation() *github.App
- func (c *ContentReferenceEvent) GetRepo() *github.Repository
- func (c *ContentReferenceEvent) GetSender() *github.User
- type EventHandlers
- func (c *EventHandlers) OnCheckRun(...) *EventHandlers
- func (c *EventHandlers) OnCheckSuite(...) *EventHandlers
- func (c *EventHandlers) OnCommitComment(...) *EventHandlers
- func (c *EventHandlers) OnContentReference(...) *EventHandlers
- func (c *EventHandlers) OnCreate(...) *EventHandlers
- func (c *EventHandlers) OnDelete(...) *EventHandlers
- func (c *EventHandlers) OnDeployment(...) *EventHandlers
- func (c *EventHandlers) OnDeploymentStatus(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnFork(...) *EventHandlers
- func (c *EventHandlers) OnGollum(...) *EventHandlers
- func (c *EventHandlers) OnInstallation(...) *EventHandlers
- func (c *EventHandlers) OnInstallationRepositories(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnIssueComment(...) *EventHandlers
- func (c *EventHandlers) OnIssues(...) *EventHandlers
- func (c *EventHandlers) OnLabel(...) *EventHandlers
- func (c *EventHandlers) OnMarketplacePurchase(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnMember(...) *EventHandlers
- func (c *EventHandlers) OnMembership(...) *EventHandlers
- func (c *EventHandlers) OnMilestone(...) *EventHandlers
- func (c *EventHandlers) OnOrgBlock(...) *EventHandlers
- func (c *EventHandlers) OnOrganization(...) *EventHandlers
- func (c *EventHandlers) OnPageBuild(...) *EventHandlers
- func (c *EventHandlers) OnPing(...) *EventHandlers
- func (c *EventHandlers) OnProject(...) *EventHandlers
- func (c *EventHandlers) OnProjectCard(...) *EventHandlers
- func (c *EventHandlers) OnProjectColumn(...) *EventHandlers
- func (c *EventHandlers) OnPublic(...) *EventHandlers
- func (c *EventHandlers) OnPullRequest(...) *EventHandlers
- func (c *EventHandlers) OnPullRequestReview(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnPullRequestReviewComment(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnPush(...) *EventHandlers
- func (c *EventHandlers) OnRelease(...) *EventHandlers
- func (c *EventHandlers) OnRepository(...) *EventHandlers
- func (c *EventHandlers) OnRepositoryImport(...) *EventHandlers
- func (c *EventHandlers) OnRepositoryVulnerabilityAlert(eventHandler func(uri *url.URL, payload *github.WebHookPayload, ...)) *EventHandlers
- func (c *EventHandlers) OnSecurityAdvisory(...) *EventHandlers
- func (c *EventHandlers) OnStatus(...) *EventHandlers
- func (c *EventHandlers) OnTeam(...) *EventHandlers
- func (c *EventHandlers) OnTeamAdd(...) *EventHandlers
- func (c *EventHandlers) OnWatch(...) *EventHandlers
- type FirstPatchedVersion
- type Identifiers
- type Package
- type References
- type RepositoryImportEvent
- type SecurityAdvisory
- func (s *SecurityAdvisory) GetDescription() string
- func (s *SecurityAdvisory) GetGhsaID() string
- func (s *SecurityAdvisory) GetPublishedAt() github.Timestamp
- func (s *SecurityAdvisory) GetSeverity() string
- func (s *SecurityAdvisory) GetSummary() string
- func (s *SecurityAdvisory) GetUpdatedAt() github.Timestamp
- func (s *SecurityAdvisory) GetWithdrawnAt() github.Timestamp
- type SecurityAdvisoryEvent
- type Vulnerabilities
- type WebHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAllEventTypes ¶
func WithAllEventTypes(server *WebHook)
WithAllEventTypes accept all possible event types.
func WithEventTypes ¶
WithEventTypes define accepted event types.
func WithSecret ¶
WithSecret define the GitHub secret.
Types ¶
type ContentReference ¶
type ContentReference struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` Reference *string `json:"reference,omitempty"` }
ContentReference represents a GitHub Content Reference.
func (*ContentReference) GetID ¶
func (c *ContentReference) GetID() int64
GetID returns the ID field if it's non-nil, zero value otherwise.
func (*ContentReference) GetNodeID ¶
func (c *ContentReference) GetNodeID() string
GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.
func (*ContentReference) GetReference ¶
func (c *ContentReference) GetReference() string
GetReference returns the Reference field if it's non-nil, zero value otherwise.
type ContentReferenceEvent ¶
type ContentReferenceEvent struct { Action *string `json:"action,omitempty"` ContentReference *ContentReference `json:"content_reference,omitempty"` Repo *github.Repository `json:"repository,omitempty"` Sender *github.User `json:"sender,omitempty"` Installation *github.App `json:"installation,omitempty"` }
ContentReferenceEvent is triggered when the body or comment of an issue or pull request includes a URL that matches a configured content reference domain. Only GitHub Apps can receive this event.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#contentreferenceevent
func (*ContentReferenceEvent) GetAction ¶
func (c *ContentReferenceEvent) GetAction() string
GetAction returns the Action field if it's non-nil, zero value otherwise.
func (*ContentReferenceEvent) GetContentReference ¶
func (c *ContentReferenceEvent) GetContentReference() *ContentReference
GetContentReference returns the ContentReference field.
func (*ContentReferenceEvent) GetInstallation ¶
func (c *ContentReferenceEvent) GetInstallation() *github.App
GetInstallation returns the Installation field.
func (*ContentReferenceEvent) GetRepo ¶
func (c *ContentReferenceEvent) GetRepo() *github.Repository
GetRepo returns the Repo field.
func (*ContentReferenceEvent) GetSender ¶
func (c *ContentReferenceEvent) GetSender() *github.User
GetSender returns the Sender field.
type EventHandlers ¶
type EventHandlers struct {
// contains filtered or unexported fields
}
EventHandlers all event handlers
func NewEventHandlers ¶
func NewEventHandlers() *EventHandlers
NewEventHandlers create a new event handlers.
func (*EventHandlers) OnCheckRun ¶
func (c *EventHandlers) OnCheckRun(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.CheckRunEvent)) *EventHandlers
OnCheckRun CheckRun handler.
func (*EventHandlers) OnCheckSuite ¶
func (c *EventHandlers) OnCheckSuite(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.CheckSuiteEvent)) *EventHandlers
OnCheckSuite CheckSuite handler.
func (*EventHandlers) OnCommitComment ¶
func (c *EventHandlers) OnCommitComment(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.CommitCommentEvent)) *EventHandlers
OnCommitComment CommitComment handler.
func (*EventHandlers) OnContentReference ¶
func (c *EventHandlers) OnContentReference(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *ContentReferenceEvent)) *EventHandlers
OnContentReference ContentReference handler.
func (*EventHandlers) OnCreate ¶
func (c *EventHandlers) OnCreate(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.CreateEvent)) *EventHandlers
OnCreate Create handler.
func (*EventHandlers) OnDelete ¶
func (c *EventHandlers) OnDelete(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.DeleteEvent)) *EventHandlers
OnDelete Delete handler.
func (*EventHandlers) OnDeployment ¶
func (c *EventHandlers) OnDeployment(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.DeploymentEvent)) *EventHandlers
OnDeployment Deployment handler.
func (*EventHandlers) OnDeploymentStatus ¶
func (c *EventHandlers) OnDeploymentStatus(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.DeploymentStatusEvent)) *EventHandlers
OnDeploymentStatus DeploymentStatus handler.
func (*EventHandlers) OnFork ¶
func (c *EventHandlers) OnFork(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.ForkEvent)) *EventHandlers
OnFork Fork handler.
func (*EventHandlers) OnGollum ¶
func (c *EventHandlers) OnGollum(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.GollumEvent)) *EventHandlers
OnGollum Gollum handler.
func (*EventHandlers) OnInstallation ¶
func (c *EventHandlers) OnInstallation(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.InstallationEvent)) *EventHandlers
OnInstallation Installation handler.
func (*EventHandlers) OnInstallationRepositories ¶
func (c *EventHandlers) OnInstallationRepositories(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.InstallationRepositoriesEvent)) *EventHandlers
OnInstallationRepositories InstallationRepositories handler.
func (*EventHandlers) OnIssueComment ¶
func (c *EventHandlers) OnIssueComment(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.IssueCommentEvent)) *EventHandlers
OnIssueComment IssueComment handler.
func (*EventHandlers) OnIssues ¶
func (c *EventHandlers) OnIssues(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.IssuesEvent)) *EventHandlers
OnIssues Issues handler.
func (*EventHandlers) OnLabel ¶
func (c *EventHandlers) OnLabel(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.LabelEvent)) *EventHandlers
OnLabel Label handler.
func (*EventHandlers) OnMarketplacePurchase ¶
func (c *EventHandlers) OnMarketplacePurchase(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.MarketplacePurchaseEvent)) *EventHandlers
OnMarketplacePurchase MarketplacePurchase handler.
func (*EventHandlers) OnMember ¶
func (c *EventHandlers) OnMember(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.MemberEvent)) *EventHandlers
OnMember Member handler.
func (*EventHandlers) OnMembership ¶
func (c *EventHandlers) OnMembership(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.MembershipEvent)) *EventHandlers
OnMembership Membership handler.
func (*EventHandlers) OnMilestone ¶
func (c *EventHandlers) OnMilestone(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.MilestoneEvent)) *EventHandlers
OnMilestone Milestone handler.
func (*EventHandlers) OnOrgBlock ¶
func (c *EventHandlers) OnOrgBlock(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.OrgBlockEvent)) *EventHandlers
OnOrgBlock OrgBlock handler.
func (*EventHandlers) OnOrganization ¶
func (c *EventHandlers) OnOrganization(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.OrganizationEvent)) *EventHandlers
OnOrganization Organization handler.
func (*EventHandlers) OnPageBuild ¶
func (c *EventHandlers) OnPageBuild(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PageBuildEvent)) *EventHandlers
OnPageBuild PageBuild handler.
func (*EventHandlers) OnPing ¶
func (c *EventHandlers) OnPing(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PingEvent)) *EventHandlers
OnPing Ping handler.
func (*EventHandlers) OnProject ¶
func (c *EventHandlers) OnProject(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.ProjectEvent)) *EventHandlers
OnProject Project handler.
func (*EventHandlers) OnProjectCard ¶
func (c *EventHandlers) OnProjectCard(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.ProjectCardEvent)) *EventHandlers
OnProjectCard ProjectCard handler.
func (*EventHandlers) OnProjectColumn ¶
func (c *EventHandlers) OnProjectColumn(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.ProjectColumnEvent)) *EventHandlers
OnProjectColumn ProjectColumn handler.
func (*EventHandlers) OnPublic ¶
func (c *EventHandlers) OnPublic(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PublicEvent)) *EventHandlers
OnPublic Public handler.
func (*EventHandlers) OnPullRequest ¶
func (c *EventHandlers) OnPullRequest(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PullRequestEvent)) *EventHandlers
OnPullRequest PullRequest handler.
func (*EventHandlers) OnPullRequestReview ¶
func (c *EventHandlers) OnPullRequestReview(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PullRequestReviewEvent)) *EventHandlers
OnPullRequestReview PullRequestReview handler.
func (*EventHandlers) OnPullRequestReviewComment ¶
func (c *EventHandlers) OnPullRequestReviewComment(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PullRequestReviewCommentEvent)) *EventHandlers
OnPullRequestReviewComment PullRequestReviewComment handler.
func (*EventHandlers) OnPush ¶
func (c *EventHandlers) OnPush(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.PushEvent)) *EventHandlers
OnPush Push handler.
func (*EventHandlers) OnRelease ¶
func (c *EventHandlers) OnRelease(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.ReleaseEvent)) *EventHandlers
OnRelease Release handler.
func (*EventHandlers) OnRepository ¶
func (c *EventHandlers) OnRepository(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.RepositoryEvent)) *EventHandlers
OnRepository Repository handler.
func (*EventHandlers) OnRepositoryImport ¶
func (c *EventHandlers) OnRepositoryImport(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *RepositoryImportEvent)) *EventHandlers
OnRepositoryImport RepositoryImport handler.
func (*EventHandlers) OnRepositoryVulnerabilityAlert ¶
func (c *EventHandlers) OnRepositoryVulnerabilityAlert(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.RepositoryVulnerabilityAlertEvent)) *EventHandlers
OnRepositoryVulnerabilityAlert RepositoryVulnerabilityAlert handler.
func (*EventHandlers) OnSecurityAdvisory ¶
func (c *EventHandlers) OnSecurityAdvisory(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *SecurityAdvisoryEvent)) *EventHandlers
OnSecurityAdvisory SecurityAdvisory handler.
func (*EventHandlers) OnStatus ¶
func (c *EventHandlers) OnStatus(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.StatusEvent)) *EventHandlers
OnStatus Status handler.
func (*EventHandlers) OnTeam ¶
func (c *EventHandlers) OnTeam(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.TeamEvent)) *EventHandlers
OnTeam Team handler.
func (*EventHandlers) OnTeamAdd ¶
func (c *EventHandlers) OnTeamAdd(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.TeamAddEvent)) *EventHandlers
OnTeamAdd TeamAdd handler.
func (*EventHandlers) OnWatch ¶
func (c *EventHandlers) OnWatch(eventHandler func(uri *url.URL, payload *github.WebHookPayload, event *github.WatchEvent)) *EventHandlers
OnWatch Watch handler.
type FirstPatchedVersion ¶
type FirstPatchedVersion struct {
Identifier *string `json:"identifier,omitempty"`
}
FirstPatchedVersion represents a GitHub Security Advisory First Patched Version.
func (*FirstPatchedVersion) GetIdentifier ¶
func (f *FirstPatchedVersion) GetIdentifier() string
GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise.
type Identifiers ¶
type Identifiers struct { Value *string `json:"value,omitempty"` Type *string `json:"type,omitempty"` }
Identifiers represents a GitHub Security Advisory Identifiers.
func (*Identifiers) GetType ¶
func (i *Identifiers) GetType() string
GetType returns the Type field if it's non-nil, zero value otherwise.
func (*Identifiers) GetValue ¶
func (i *Identifiers) GetValue() string
GetValue returns the Value field if it's non-nil, zero value otherwise.
type Package ¶
type Package struct { Ecosystem *string `json:"ecosystem,omitempty"` Name *string `json:"name,omitempty"` }
Package represents a GitHub Security Advisory Package.
func (*Package) GetEcosystem ¶
GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.
type References ¶
type References struct {
URL *string `json:"url,omitempty"`
}
References represents a GitHub Security Advisory References.
func (*References) GetURL ¶
func (r *References) GetURL() string
GetURL returns the URL field if it's non-nil, zero value otherwise.
type RepositoryImportEvent ¶
type RepositoryImportEvent struct { Status *string `json:"status,omitempty"` Repo *github.Repository `json:"repository,omitempty"` Organization *github.Organization `json:"organization,omitempty"` Sender *github.User `json:"sender,omitempty"` }
RepositoryImportEvent is triggered when a successful, canceled, or failed repository import finishes for a GitHub organization or a personal repository.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#repositoryimportevent
func (*RepositoryImportEvent) GetOrganization ¶
func (r *RepositoryImportEvent) GetOrganization() *github.Organization
GetOrganization returns the Organization field.
func (*RepositoryImportEvent) GetRepo ¶
func (r *RepositoryImportEvent) GetRepo() *github.Repository
GetRepo returns the Repo field.
func (*RepositoryImportEvent) GetSender ¶
func (r *RepositoryImportEvent) GetSender() *github.User
GetSender returns the Sender field.
func (*RepositoryImportEvent) GetStatus ¶
func (r *RepositoryImportEvent) GetStatus() string
GetStatus returns the Status field if it's non-nil, zero value otherwise.
type SecurityAdvisory ¶
type SecurityAdvisory struct { GhsaID *string `json:"ghsa_id,omitempty"` Summary *string `json:"summary,omitempty"` Description *string `json:"description,omitempty"` Severity *string `json:"severity,omitempty"` Identifiers []Identifiers `json:"identifiers,omitempty"` References []References `json:"references,omitempty"` PublishedAt *github.Timestamp `json:"published_at,omitempty"` UpdatedAt *github.Timestamp `json:"updated_at,omitempty"` WithdrawnAt *github.Timestamp `json:"withdrawn_at,omitempty"` Vulnerabilities []Vulnerabilities `json:"vulnerabilities,omitempty"` }
SecurityAdvisory represents a GitHub Security Advisory.
func (*SecurityAdvisory) GetDescription ¶
func (s *SecurityAdvisory) GetDescription() string
GetDescription returns the Description field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetGhsaID ¶
func (s *SecurityAdvisory) GetGhsaID() string
GetGhsaID returns the GhsaID field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetPublishedAt ¶
func (s *SecurityAdvisory) GetPublishedAt() github.Timestamp
GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetSeverity ¶
func (s *SecurityAdvisory) GetSeverity() string
GetSeverity returns the Severity field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetSummary ¶
func (s *SecurityAdvisory) GetSummary() string
GetSummary returns the Summary field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetUpdatedAt ¶
func (s *SecurityAdvisory) GetUpdatedAt() github.Timestamp
GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.
func (*SecurityAdvisory) GetWithdrawnAt ¶
func (s *SecurityAdvisory) GetWithdrawnAt() github.Timestamp
GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise.
type SecurityAdvisoryEvent ¶
type SecurityAdvisoryEvent struct { Action *string `json:"action,omitempty"` SecurityAdvisory *SecurityAdvisory `json:"security_advisory,omitempty"` }
SecurityAdvisoryEvent is triggered when a new security advisory is published, updated, or withdrawn. A security advisory provides information about security-related vulnerabilities in software on GitHub.
GitHub API docs: https://developer.github.com/v3/activity/events/types/#securityadvisoryevent
func (*SecurityAdvisoryEvent) GetAction ¶
func (s *SecurityAdvisoryEvent) GetAction() string
GetAction returns the Action field if it's non-nil, zero value otherwise.
func (*SecurityAdvisoryEvent) GetSecurityAdvisory ¶
func (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory
GetSecurityAdvisory returns the SecurityAdvisory field.
type Vulnerabilities ¶
type Vulnerabilities struct { Package *Package `json:"package,omitempty"` Severity *string `json:"severity,omitempty"` VulnerableVersionRange *string `json:"vulnerable_version_range,omitempty"` FirstPatchedVersion *FirstPatchedVersion `json:"first_patched_version,omitempty"` }
Vulnerabilities represents a GitHub Security Advisory Vulnerabilities.
func (*Vulnerabilities) GetFirstPatchedVersion ¶
func (v *Vulnerabilities) GetFirstPatchedVersion() *FirstPatchedVersion
GetFirstPatchedVersion returns the FirstPatchedVersion field.
func (*Vulnerabilities) GetPackage ¶
func (v *Vulnerabilities) GetPackage() *Package
GetPackage returns the Package field.
func (*Vulnerabilities) GetSeverity ¶
func (v *Vulnerabilities) GetSeverity() string
GetSeverity returns the Severity field if it's non-nil, zero value otherwise.
func (*Vulnerabilities) GetVulnerableVersionRange ¶
func (v *Vulnerabilities) GetVulnerableVersionRange() string
GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise.
type WebHook ¶
type WebHook struct {
// contains filtered or unexported fields
}
WebHook server
func NewWebHook ¶
func NewWebHook(eventHandlers *EventHandlers, options ...serverOption) *WebHook
NewWebHook create a new server as a GitHub WebHook.
func (*WebHook) ListenAndServe ¶
ListenAndServe run GitHub WebHook server.