Documentation ¶
Overview ¶
Package clwebserver implements serving of HTTP
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewListener ¶
func NewListener(cfg Config) (*net.TCPListener, error)
NewListener provides a tcp connection listener for the webserver.
Types ¶
type Config ¶
type Config struct { // BindAddrPort configures where the web server will listen for incoming tcp traffic BindAddrPort string `env:"BIND_ADDR_PORT" envDefault:"127.0.0.1:8282"` // HTTP read timeout, See: https://blog.cloudflare.com/exposing-go-on-the-internet/ ReadTimeout time.Duration `env:"READ_TIMEOUT" envDefault:"5s"` // HTTP write timeout, See: https://blog.cloudflare.com/exposing-go-on-the-internet/ WriteTimeout time.Duration `env:"WRITE_TIMEOUT" envDefault:"12s"` // HTTP idle timeout, See: https://blog.cloudflare.com/exposing-go-on-the-internet/ IdleTimeout time.Duration `env:"IDLE_TIMEOUT" envDefault:"120s"` }
Config configures the http server.
Click to show internal directories.
Click to hide internal directories.