func newHTTPSink(u string, timeout time.Duration, headers http.Header, transport *http.Transport, listeners ...httpStatusListener) *httpSink {
	if transport == nil {
		transport = http.DefaultTransport.(*http.Transport)
	}
	return &httpSink{
		url:       u,
		listeners: listeners,
		client: &http.Client{
			Transport: &headerRoundTripper{
				Transport: transport,
				headers:   headers,
			},
			Timeout: timeout,
		},
	}
}
newHTTPSink returns an unreliable, single-flight http sink. Wrap in other
sinks for increased reliability.
package notifications
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"sync"
	"time"
)
type httpSink struct {
	url string
	mu        sync.Mutex
	closed    bool
	client    *http.Client
	listeners []httpStatusListener
}