package srv import ( "log" "net/http" "time" "gitlab.com/mokhax/spike/pkg/cfg" ) func New(c *cfg.Config) *http.Server { return &http.Server{ Addr: c.BindAddress, Handler: c.Mux, TLSConfig: c.TLS, ReadHeaderTimeout: 10 * time.Second, ReadTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second, IdleTimeout: 30 * time.Second, ErrorLog: log.Default(), } } func Run(c *cfg.Config) error { return c.Run(New(c)) }