func New(options sentryhttp.Options) *Handler {
	handler := Handler{
		repanic:         false,
		timeout:         time.Second * 2,
		waitForDelivery: false,
	}
	if options.Repanic {
		handler.repanic = true
	}
	if options.Timeout != 0 {
		handler.timeout = options.Timeout
	}
	if options.WaitForDelivery {
		handler.waitForDelivery = true
	}
	return &handler
}
New returns a struct that provides Handle and HandleFunc methods
that satisfy http.Handler and http.HandlerFunc interfaces.
package sentry
import (
	"context"
	"fmt"
	"net/http"
	"time"
	"github.com/getsentry/sentry-go"
	sentryhttp "github.com/getsentry/sentry-go/http"
	"github.com/julienschmidt/httprouter"
)
type Handler struct {
	repanic         bool
	waitForDelivery bool
	timeout         time.Duration
}
func (h *Handler) HandleFunc(handler http.HandlerFunc) http.HandlerFunc {
	return func(rw http.ResponseWriter, r *http.Request) {
		ctx := r.Context()
		hub := sentry.GetHubFromContext(ctx)
		if hub == nil {
			hub = sentry.CurrentHub().Clone()
			ctx = sentry.SetHubOnContext(ctx, hub)
		}
		span := sentry.StartSpan(ctx, "http.server",
			sentry.TransactionName(fmt.Sprintf("%s %s", r.Method, r.URL.Path)),
			sentry.ContinueFromRequest(r),
		)
		defer span.Finish()
		r = r.WithContext(span.Context())
		hub.Scope().SetRequest(r)
		defer h.recoverWithSentry(hub, r)
		handler.ServeHTTP(rw, r)
	}
}