Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OsExitError = errors.New("os exit signal")
Functions ¶
func CreateAndRunServer ¶
func CreateAndRunServer(constructor Constructor, gracefulTimeout time.Duration) (err error)
CreateAndRunServer creates, initializes and starts a Server. Also makes sure that all the subroutines are finished before exiting.
Types ¶
type BasicHttpServer ¶
type BasicHttpServer struct { BasicServer Srv *http.Server }
BasicHttpServer implements the Start() and Shutdown() functions of the Server interface. Implement Init() to initialize the routing and the constructor to instantiate dependencies.
func (*BasicHttpServer) Start ¶
func (b *BasicHttpServer) Start()
type BasicServer ¶
func (*BasicServer) Init ¶ added in v2.0.2
func (b *BasicServer) Init()
type Server ¶
Server is an interface for implementing concurrent servers. CreateAndRunServer() implements a graceful shutdown waiting for all the resources to close.
It calls Init() and Start() on the server.
Use BasicServer.Group to start goroutines When implementing an http server, use BasicHttpServer struct.
Click to show internal directories.
Click to hide internal directories.