Documentation
¶
Overview ¶
Package gracehttp provides easy to use graceful restart functionality for HTTP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreStartProcess ¶
func PreStartProcess(hook func() error) option
PreStartProcess configures a callback to trigger during graceful restart directly before starting the successor process. This allows the current process to release holds on resources that the new process will need.
func Serve ¶
Serve will serve the given http.Servers and will monitor for signals allowing for graceful termination (SIGTERM) or restart (SIGUSR2).
func ServeWithOptions ¶
func ServeWithOptions(servers []*http.Server, gservers []*GRPCServer, options ...option) error
ServeWithOptions does the same as Serve, but takes a set of options to configure the app struct.
Types ¶
type GRPCServer ¶
type GRPCServer struct { Addr string // address Server *grpc.Server // contains filtered or unexported fields }
GRPCServer grpc.Server packaging
func NewGRPCServer ¶
func NewGRPCServer(Addr string, Server *grpc.Server) *GRPCServer
NewGRPCServer GRPCServer package factory
func (*GRPCServer) Stop ¶
func (s *GRPCServer) Stop() error
close implement interface for httpdown.Server
func (*GRPCServer) Wait ¶
func (s *GRPCServer) Wait() error
Wait implement interface for httpdown.Server