Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateWebhook ¶
func ValidateWebhook(w http.ResponseWriter, r *http.Request, hmacSecret []byte) (string, string, []byte, bool)
ValidateWebhook ensures that the provided request conforms to the format of a Github webhook and the payload can be validated with the provided hmac secret. It returns the event type, the event guid, the payload of the request, and whether the webhook is valid or not.
Types ¶
type Metrics ¶
type Metrics struct {
WebhookCounter *prometheus.CounterVec
}
func NewMetrics ¶
func NewMetrics() *Metrics
type Server ¶
type Server struct { Plugins *plugins.PluginAgent ConfigAgent *config.Agent TokenGenerator func() []byte Metrics *Metrics // contains filtered or unexported fields }
Server implements http.Handler. It validates incoming GitHub webhooks and then dispatches them to the appropriate plugins.
func (*Server) GracefulShutdown ¶
func (s *Server) GracefulShutdown()
Implements a graceful shutdown protool. Handles all requests sent before receiving shutdown signal.
Click to show internal directories.
Click to hide internal directories.