Documentation
¶
Overview ¶
Package server ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoListeners is returned when Server.Serve() is called before // Server.Listen() ErrNoListeners = errors.New("server: no listeners defined") // ErrMissingListener is returned by Server.Serve() when the number of // listeners created by Server.Listen() doesn't match the number of // listeners set in Config.Listeners. ErrMissingListener = errors.New("server: missing listener") // ErrAlreadyServing is returned by Server.Serve() when there are already // servers listening. Before calling Server.Serve() again, Server.Close() // should be called to ensure all servers and listeners are closed. ErrAlreadyServing = errors.New("server: already serving") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Listeners is a slice of listeners to bind to. Listeners []listener.Listener }
Config represents the configuration for a Server.
type Opt ¶
Opt is a configuration option to initialize a server.
func WithListener ¶
WithListener adds another listener to the server.
Click to show internal directories.
Click to hide internal directories.