Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnhealthy is returned when a server is considered unhealthy. ErrUnhealthy = errors.New("Service is unhealthy") )
Functions ¶
This section is empty.
Types ¶
type HealthPinger ¶
type HealthPinger interface {
Ping() error
}
HealthPinger exposes what we expect to provide us a Health check for a server.
type HttpHealthIndicator ¶
type HttpHealthIndicator struct {
// contains filtered or unexported fields
}
func (*HttpHealthIndicator) Ping ¶
func (h *HttpHealthIndicator) Ping() error
Ping implements the HealthPinger interface.
func (*HttpHealthIndicator) SetHealthy ¶
func (h *HttpHealthIndicator) SetHealthy()
func (*HttpHealthIndicator) SetUnhealthy ¶
func (h *HttpHealthIndicator) SetUnhealthy()
type Server ¶
type Server struct { Http2 bool ShutdownTimeout time.Duration Handler http.Handler ReadyFunc func() Health *HttpHealthIndicator TLSConfig *tls.Config Man *autocert.Manager // contains filtered or unexported fields }
Server implements a http server wrapper.
func NewServerWithCertMan ¶
func NewServerWithCertMan(http2 bool, man *autocert.Manager, handler http.Handler, shutdown ...time.Duration) *Server
NewServerWithCertMan returns a new server which uses the provided autocert certificate manager to provide http certificate.
func NewServerWithTLS ¶
func NewServerWithTLS(http2 bool, tconfig *tls.Config, handler http.Handler, shutdown ...time.Duration) *Server
NewServerWithTLS returns a new server which uses the provided tlsconfig for https connections.
func (*Server) Listen ¶
Listen creates new http listen for giving addr and returns any error that occurs in attempt to starting the server.
func (*Server) TLSManager ¶
TLSManager returns the autocert.Manager associated with the giving server for its tls certificates.
Click to show internal directories.
Click to hide internal directories.