Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ServerContextCancelled denotes when a server run returns because its context is cancelled ServerContextCancelled = "Server context cancelled" // ServerReceivedInterrupt denotes when a server run returns because its context is cancelled ServerReceivedInterrupt = "Server received interrupt signal" )
Variables ¶
View Source
var ( // ErrContextCancelled denotes when a server run returns because its context is cancelled ErrContextCancelled error = fmt.Errorf(ServerContextCancelled) // ErrReceivedInterrupt denotes when a server run returns because it received an interrupt signal ErrReceivedInterrupt error = fmt.Errorf(ServerReceivedInterrupt) )
Functions ¶
func RegisterHandler ¶
RegisterHandler registers a handler for a path with the default serve mux
func Run ¶
func Run(ctx context.Context, certs *[]tls.Certificate, mux *http.ServeMux, portEnvKey string) (address string, reportedError chan Error)
Run executes the main server loop in a goroutine
It allows consumer cancellation through the context and server-side cancellation notification via the returned `reportedError` channel
Fatal errors will be sent to the returned channel and the server will shutdown
Types ¶
Click to show internal directories.
Click to hide internal directories.