Documentation
¶
Index ¶
Constants ¶
View Source
const ( // LocalHost is the name of the localhost LocalHost = "localhost" // DefaultPort is the default port used for service DefaultPort = "4430" // HeartBeatName is the name of the heartbeat service HeartBeatName = "heartbeat" // 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 - a server returns because its context is cancelled ErrContextCancelled = fmt.Errorf(ServerContextCancelled) // ErrReceivedInterrupt - a server returns because it received an interrupt signal ErrReceivedInterrupt = fmt.Errorf(ServerReceivedInterrupt) )
Functions ¶
func Run ¶
func Run( ctx context.Context, certs *[]tls.Certificate, mux *http.ServeMux, portEnvKey string, enableHeartBeat bool, ) (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.