server

package
v0.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ServerShutdownTimeout = 60 * time.Second

ServerShutdownTimeout is the default time to wait before closing connections on shutdown.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server is a incomplete component that implements a basic HTTP/HTTPS server.

func New

func New(addr string, handler http.Handler, tlsConfig *tls.Config) *Server

New creates a new HTTP/HTTPS server configured with the passed address, http.Handler and tls.Config.

func (*Server) Forbidden

func (srv *Server) Forbidden(w http.ResponseWriter)

Forbidden writes on the http.ResponseWriter a text/plain forbidden response.

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() error

ListenAndServe listens on the TCP network address srv.Addr and then calls Serve to handle requests on incoming connections.

func (*Server) Reload

func (srv *Server) Reload(ns *Server) error

Reload reloads the current server with the configuration of the passed server.

func (*Server) Serve

func (srv *Server) Serve(ln net.Listener) error

Serve runs Serve or ServeTLS on the underlying http.Server and listen to channels to reload or shutdown the server.

func (*Server) Shutdown

func (srv *Server) Shutdown() error

Shutdown gracefully shuts down the server without interrupting any active connections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL