func NewStarter(o StartOptions, s httpServer) func() error {
	if o.Logger == nil {
		o.Logger = logging.DefaultLogger()
	}
	s.SetKeepAlivesEnabled(!o.DisableKeepAlives)
	var starter func() error
	if o.Listener != nil {
		starter = func() error {
			return s.Serve(o.Listener)
		}
	} else {
		starter = func() error {
			return s.ListenAndServe()
		}
	}
	return func() error {
		o.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "starting server")
		err := starter()
		if err == http.ErrServerClosed {
			o.Logger.Log(level.Key(), level.InfoValue(), logging.MessageKey(), "server closed")
		} else {
			o.Logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "server exited", logging.ErrorKey(), err)
		}
		return err
	}
}
NewStarter returns a starter closure for the given HTTP server.  The start options are first
applied to the server instance, and the server instance must not have already been started prior
to invoking this method.

The returned closure will invoke the correct method on the server to start it, e.g. Serve, ServeTLS, etc.
The selection of which server method is based on the options.  For example, if CertificateFile and KeyFile
are set, either of the xxxTLS methods will be invoked based on whether there is a Listener configured.

Note: tlsConfig is expected to already be set
package xhttp
import (
	stdlog "log"
	"net"
	"net/http"
	"time"
	"github.com/go-kit/kit/log"
	"github.com/go-kit/kit/log/level"
	"github.com/xmidt-org/webpa-common/v2/logging"
)
var (
	serverKey interface{} = "server"
)
func ServerKey() interface{} {
	return serverKey
}
func NewServerLogger(logger log.Logger) *stdlog.Logger {
	if logger == nil {
		logger = logging.DefaultLogger()
	}
	return stdlog.New(
		log.NewStdlibAdapter(logger),
		"",  
		stdlog.LstdFlags|stdlog.LUTC,
	)
}
func NewServerConnStateLogger(logger log.Logger) func(net.Conn, http.ConnState) {
	if logger == nil {
		logger = logging.DefaultLogger()
	}
	return func(c net.Conn, cs http.ConnState) {
		logger.Log(
			"remoteAddress", c.RemoteAddr(),
			"state", cs,
		)
	}
}
type StartOptions struct {
	Logger log.Logger `json:"-"`
	Listener net.Listener `json:"-"`
	DisableKeepAlives bool `json:"disableKeepAlives,omitempty"`
	CertificateFile []string `json:"certificateFile,omitempty"`
	KeyFile []string `json:"keyFile,omitempty"`
}