Documentation
¶
Index ¶
- Variables
- func HTTPListenAndServe(address string, handler http.Handler) error
- func HTTPListenAndServeCtx(ctx context.Context, server *http.Server) error
- func Listen(address string) (net.Listener, error)
- func ListenWithConfig(config *net.ListenConfig, address string) (net.Listener, error)
- func MustHTTPListenAndServe(address string, handler http.Handler)
- func MustHTTPListenAndServeCtx(ctx context.Context, server *http.Server)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultListenConfig = &net.ListenConfig{}
DefaultListenConfig is the default ListenConfig used for Listen().
View Source
var HTTPShutdownTimeout = 5 * time.Second
HTTPShutdownTimeout is the timeout to wait when shutting down HTTP.
Functions ¶
func HTTPListenAndServe ¶
HTTPListenAndServe listens and serves HTTP until a SIGINT is received.
func HTTPListenAndServeCtx ¶
HTTPListenAndServeCtx listens to the address set in http.Server and serves HTTP. It gracefully exits if the given ctx expires.
func ListenWithConfig ¶
ListenWithConfig listens for incoming connections using the given address string. The address can be formatted as such:
127.0.0.1:29485 (implicitly tcp) tcp://127.0.0.1:29485 tcp4://127.0.0.1:29485 unix:///tmp/path/to/socket.sock (will be automatically cleaned up) unixpacket:///tmp/path/to/socket.sock (same as unix)
func MustHTTPListenAndServe ¶
MustHTTPListenAndServe is HTTPListenAndServe that log.Fatals on an error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.