Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener interface { // Start is being called on the listener Start(context.Context, ReadyFunc) func() error }
Listener is the interface to a listener, so starting and shutdown of a listener, or any routine.
type ReadyFunc ¶
type ReadyFunc func()
ReadyFunc is the function that is called by Listener to signal that it is ready and the next Listener can be called.
type Server ¶
type Server interface { // Run is running a new go routine Listen(listener Listener, ready bool) // Waits for the server to fail, // or gracefully shutdown if context is canceled Wait() error }
Server is the interface to be implemented to run the server.
s, ctx := WithContext(context.Background()) s.Listen(listener, false) if err := s.Wait(); err != nil { panic(err) }
Click to show internal directories.
Click to hide internal directories.