server_win.go 415 B

12345678910111213141516171819
  1. // +build windows
  2. package router
  3. import (
  4. "github.com/gin-gonic/gin"
  5. "net/http"
  6. "time"
  7. )
  8. func initServer(address string, readTimeOut, writeTimeOut int, router *gin.Engine) server {
  9. return &http.Server{
  10. Addr: address,
  11. Handler: router,
  12. ReadTimeout: time.Duration(readTimeOut) * time.Second,
  13. WriteTimeout: time.Duration(writeTimeOut) * time.Second,
  14. MaxHeaderBytes: 1 << 40,
  15. }
  16. }