Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Host defaults to :8080 Host string // Router is the http router Router http.Handler // ReadTimeout defaults to 1m ReadTimeout time.Duration // IdleTimeout if it's zero Go uses by default the ReadTimeout IdleTimeout time.Duration // ReadHeaderTimeout defaults to 20s ReadHeaderTimeout time.Duration // WriteTimeout defaults to 2m WriteTimeout time.Duration // MaxHeaderBytes defaults to 1MB MaxHeaderBytes int // ExitSignals defaults to os.Interrupt // Here define the OS signals for which the http server should perform // a graceful exit ExitSignals []os.Signal // Domain by default is localhost. It is used when UseTLS = true // If you have a valid domain then it fetches a certificate from // let's encrypt. It firsts looks for a certificate in a certs folder. // See the getSelfSignedOrLetsEncryptCert function // thanks to : https://marcofranssen.nl/build-a-go-webserver-on-http-2-using-letsencrypt Domain string // UseTLS when true it uses TLS UseTLS bool }
Config contains the configuration of the web server Essentially, only the Router is mandatory in order to have a working http server with some sane defaults
Click to show internal directories.
Click to hide internal directories.