grace_reset

package
v0.0.0-...-0216257 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_READ_TIMEOUT  = 60 * time.Second
	DEFAULT_WRITE_TIMEOUT = DEFAULT_READ_TIMEOUT
)
View Source
const (
	GRACEFUL_ENVIRON_KEY    = "IS_GRACEFUL"
	GRACEFUL_ENVIRON_STRING = GRACEFUL_ENVIRON_KEY + "=1"
	GRACEFUL_LISTENER_FD    = 3
)

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(addr string, handler http.Handler) error

refer http.ListenAndServe

func ListenAndServeTLS

func ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error

refer http.ListenAndServeTLS

Types

type Server

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

HTTP server that supported graceful shutdown or restart

func NewServer

func NewServer(addr string, handler http.Handler, readTimeout, writeTimeout time.Duration) *Server

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() error

func (*Server) ListenAndServeTLS

func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error

func (*Server) Serve

func (srv *Server) Serve() error

Jump to

Keyboard shortcuts

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