Documentation ¶
Index ¶
- Constants
- Variables
- func GracefulShutdown(server *http.Server, logger *zap.SugaredLogger, stopCh <-chan struct{}, ...)
- func SecretFrom(ctx context.Context, secretCli clientcorev1.SecretInterface, ...) (string, error)
- func SubjectAndExtensionsFromGitHubEvent(gitHubEvent gh.Event, payload interface{}, logger *zap.SugaredLogger) (string, map[string]interface{})
- type Handler
Constants ¶
View Source
const ( GHHeaderEvent = "X-GitHub-Event" GHHeaderDelivery = "X-GitHub-Delivery" )
Variables ¶
View Source
var ValidEvents = []gh.Event{ gh.CheckRunEvent, gh.CheckSuiteEvent, gh.CommitCommentEvent, gh.CreateEvent, gh.DeleteEvent, gh.DeploymentEvent, gh.DeploymentStatusEvent, gh.ForkEvent, gh.GollumEvent, gh.InstallationEvent, gh.InstallationRepositoriesEvent, gh.IntegrationInstallationEvent, gh.IntegrationInstallationRepositoriesEvent, gh.IssueCommentEvent, gh.IssuesEvent, gh.LabelEvent, gh.MemberEvent, gh.MembershipEvent, gh.MilestoneEvent, gh.OrganizationEvent, gh.OrgBlockEvent, gh.PageBuildEvent, gh.PingEvent, gh.ProjectCardEvent, gh.ProjectColumnEvent, gh.ProjectEvent, gh.PublicEvent, gh.PullRequestEvent, gh.PullRequestReviewCommentEvent, gh.PullRequestReviewEvent, gh.PushEvent, gh.ReleaseEvent, gh.RepositoryEvent, gh.RepositoryVulnerabilityAlertEvent, gh.SecurityAdvisoryEvent, gh.StatusEvent, gh.TeamAddEvent, gh.TeamEvent, gh.WatchEvent, }
Functions ¶
func GracefulShutdown ¶
func GracefulShutdown(server *http.Server, logger *zap.SugaredLogger, stopCh <-chan struct{}, done chan<- bool)
GracefulShutdown gracefully shutdown server
func SecretFrom ¶
func SecretFrom(ctx context.Context, secretCli clientcorev1.SecretInterface, sel *corev1.SecretKeySelector) (string, error)
SecretFrom gets the value of the Secret key referenced by sel from the Kubernetes cluster.
func SubjectAndExtensionsFromGitHubEvent ¶ added in v0.22.0
func SubjectAndExtensionsFromGitHubEvent(gitHubEvent gh.Event, payload interface{}, logger *zap.SugaredLogger) (string, map[string]interface{})
SubjectAndExtensionsFromGitHubEvent computes the CE subject from GitHub event
Types ¶
type Handler ¶
type Handler struct { Logger *zap.SugaredLogger Client cloudevents.Client Hook *gh.Webhook Source string SinkURI string }
func NewHandler ¶
func NewHandler(ceClient cloudevents.Client, sinkURI, source, secretToken string, logger *zap.SugaredLogger) *Handler
New creates an adapter to convert incoming GitHub webhook events from a single source to CloudEvents and then sends them to the specified Sink
Click to show internal directories.
Click to hide internal directories.