Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterServerFunc ¶
func RegisterServerFunc(name string, serveFunc func(ctx context.Context) error, shutdownFunc func(ctx context.Context) error)
see [handler.RegisterServerFunc].
func RegistryShutdownFunc ¶
func RegistryShutdownFunc(name string, f func())
RegistryShutdownFunc registers function called on shutdown to default handler.
Types ¶
type Server ¶
type Server interface {
// Name returns the name of the server, used for logging and debugging purposes.
Name() string
// Shutdown gracefully shuts down the server without interrupting any active connections.
Shutdown(ctx context.Context) error
// Serve starts the server and blocks until the server is stopped or an error occurs.
// if the server is stopped gracefully, it should return nil.
// If the server is stopped due to an error, it should return the error.
// if any server is stopped, all servers will be stopped gracefully.
Serve(ctx context.Context) error
}
Click to show internal directories.
Click to hide internal directories.