Completed webhooks package documentation
This commit is contained in:
+2
-3
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user