Documentation ¶
Overview ¶
Package http provides HTTP server implementation based on http package from the stdlib.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // TCP address to listen on. If a file path is given, the server will use a // Unix Domain Socket. Addr string // Requests handler. Just as http.Server, if nil is given, // http.DefaultServeMux will be used. Handler http.Handler ShutdownCtx func() context.Context }
Config wraps all the customizable options from Server.
type Server ¶
type Server struct { http.Server // Shutdown context used for gracefully shutdown, it is implemented as a // function since deadlines will start at server creation and not at shutdown. ShutdownCtx func() context.Context // Gracefully shutdown done notifier. Done chan struct{} }
Server is a http.Server with some extra functionalities.
func (*Server) ListenAndServe ¶
ListenAndServe listen in a TCP address for HTTP requests.
func (*Server) ListenAndServeTLS ¶
ListenAndServeTLS listen in a TCP address for HTTPS/H2 requests.
func (*Server) ListenAndServeUDS ¶
ListenAndServeUDS listen in a Unix Domain Socket for HTTPS/H2 requests.
Directories ¶
Path | Synopsis |
---|---|
Package middleware provides flexibility at the HTTP request/response process.
|
Package middleware provides flexibility at the HTTP request/response process. |
Click to show internal directories.
Click to hide internal directories.