Documentation ¶
Index ¶
- Constants
- Variables
- func GracefulShutdown(server *http.Server, logger *zap.SugaredLogger, stopCh <-chan struct{}, ...)
- func SecretFrom(kubeClientSet kubernetes.Interface, namespace string, ...) (string, error)
- func SubjectFromGitHubEvent(gitHubEvent gh.Event, payload interface{}, logger *zap.SugaredLogger) string
- type Handler
Constants ¶
View Source
const ( GHHeaderEvent = "X-GitHub-Event" GHHeaderDelivery = "X-GitHub-Delivery" )
Variables ¶
View Source
var ValidEvents = []gh.Event{ gh.CheckSuiteEvent, gh.CommitCommentEvent, gh.CommitCommentEvent, gh.CreateEvent, gh.DeleteEvent, gh.DeploymentEvent, gh.DeploymentStatusEvent, gh.ForkEvent, gh.GollumEvent, gh.InstallationEvent, gh.IntegrationInstallationEvent, 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.PullRequestReviewEvent, gh.PullRequestReviewCommentEvent, gh.PushEvent, gh.ReleaseEvent, gh.RepositoryEvent, gh.StatusEvent, gh.TeamEvent, gh.TeamAddEvent, 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(kubeClientSet kubernetes.Interface, namespace string, secretKeySelector *corev1.SecretKeySelector) (string, error)
func SubjectFromGitHubEvent ¶
func SubjectFromGitHubEvent(gitHubEvent gh.Event, payload interface{}, logger *zap.SugaredLogger) string
SubjectFromGitHubEvent 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.