From 3def7b0883b59c72dfcc268c349380bccd62d531 Mon Sep 17 00:00:00 2001 From: joeybloggs Date: Fri, 30 Oct 2015 10:50:43 -0400 Subject: [PATCH] Completed webhooks package documentation --- webhooks.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webhooks.go b/webhooks.go index bc91b07..a2807b2 100644 --- a/webhooks.go +++ b/webhooks.go @@ -61,11 +61,9 @@ func RunServer(s *http.Server, hook Webhook, path string) error { // RunTLSServer runs a custom server with TLS configuration. // NOTE: http.Server Handler will be overridden by this library, just set it to nil. // Setting the Certificates can be done in the http.Server.TLSConfig.Certificates -// see example here: +// see example here: https://github.com/joeybloggs/webhooks/blob/master/webhooks_test.go#L178 func RunTLSServer(s *http.Server, hook Webhook, path string) error { - // var err error - srv := &server{ hook: hook, path: path, @@ -76,6 +74,7 @@ func RunTLSServer(s *http.Server, hook Webhook, path string) error { return s.ListenAndServeTLS("", "") } +// ServeHTTP is the Handler for every posted WebHook Event func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) { defer r.Body.Close()