Go-based FM stereo transmitter with RDS, Windows-first and cross-platform
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

28 řádky
675B

  1. package control
  2. import (
  3. "net/http"
  4. "time"
  5. "github.com/jan/fm-rds-tx/internal/config"
  6. )
  7. const (
  8. defaultReadTimeout = 5 * time.Second
  9. defaultWriteTimeout = 10 * time.Second
  10. defaultIdleTimeout = 60 * time.Second
  11. defaultMaxHeaderBytes = 1 << 20 // 1 MiB
  12. )
  13. // NewHTTPServer returns a configured HTTP server for the control plane.
  14. func NewHTTPServer(cfg config.Config, handler http.Handler) *http.Server {
  15. return &http.Server{
  16. Addr: cfg.Control.ListenAddress,
  17. Handler: handler,
  18. ReadTimeout: defaultReadTimeout,
  19. WriteTimeout: defaultWriteTimeout,
  20. IdleTimeout: defaultIdleTimeout,
  21. MaxHeaderBytes: defaultMaxHeaderBytes,
  22. }
  23. }