Documentation ¶
Overview ¶
Package serverd provides a component to create server-type applications, helping to manage the life cycle of services and operating system signals.
This package is a work in progress and makes no API stability promises.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the services.
func (*Manager) Register ¶
Register resgisters a new service in the manager. Services cannot be registered if it has already been started.
func (*Manager) Run ¶
Run will initialize all services, install the operating system's signal handlers and block waiting for the shutdown signal. When this signal arrives, it will turn off all registered services.
type Option ¶
type Option func(*options)
Option is used for component configuration.
func ShutdownTimeout ¶
ShutdownTimeout option sets timeout for shutdowns.