server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ShutdownPeriod = 5 * time.Minute

ShutdownPeriod is the duration to wait before a blocking function should abandon its work.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option provides the client a callback that is used dynamically to specify attributes for a Server.

func WithServer

func WithServer(serv *http.Server) Option

WithServer creates an Option that is used for specifying the http.Server for a Server.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a robust server that can be easily be spun up and shut down with well implemented error handeling.

func New

func New(opts ...Option) *Server

New is a variadic constructor for a Server.

func (*Server) Shutdown

func (s *Server) Shutdown(signal os.Signal, done chan bool)

Shutdown stops the server gracefully.

func (*Server) Startup

func (s *Server) Startup() (quit chan bool)

Startup starts a robust server with well defined error handling.

Jump to

Keyboard shortcuts

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