Documentation ¶
Overview ¶
Example ¶
status := healthz.NewStatusChecker(healthz.Healthy) app := fx.New( fx.NopLogger, fxt.Bootstrap, fx.Provide( func() *fxdebug.Config { return fxdebug.NewConfig(":8080") }, fxdebug.NewHealthCollector, fxdebug.NewServer, ), fx.Invoke(func(collector healthz.Collector) { collector.RegisterChecker(healthz.ReadinessCheck, status) }), ) if err := app.Err(); err != nil { panic(err) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrServerClosed = http.ErrServerClosed
ErrServerClosed is returned by the underlying server when it stops listening after graceful or forceful shutdown is initiated.
Functions ¶
func NewHealthCollector ¶
NewHealthCollector returns a new healthz.Collector.
func NewServer ¶
func NewServer(params ServerParams) (Handler, Err)
NewServer creates a new debug server.
func NewStatusChecker ¶ added in v0.6.1
func NewStatusChecker(collector healthz.Collector) *healthz.StatusChecker
NewStatusChecker returns a new healthz.StatusChecker with "Healthy" as the default value. It also registers the checker in the health collector.
Types ¶
type Err ¶ added in v0.2.0
type Err <-chan error
Err accepts an error which causes the application to stop.
type Handler ¶
type Handler interface { http.Handler // Handle registers the handler for the given pattern. // If a handler already exists for pattern, Handle panics. Handle(pattern string, handler http.Handler) // HandleFunc registers the handler function for the given pattern. HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) }
Handler accepts an http.Handler or http.HandlerFunc and registers it for a pattern.
Click to show internal directories.
Click to hide internal directories.