common

package
v0.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GHHeaderEvent    = "X-GitHub-Event"
	GHHeaderDelivery = "X-GitHub-Delivery"
)

Variables

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

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Source Files

  • events.go
  • handler.go
  • secret.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL