Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "health", fx.Decorate(func(log *zap.Logger) *zap.Logger { return log.Named("health") }), fx.Provide( AsHealthProvider(NewDBProvider), fx.Private, ), fx.Provide( NewService, ), )
Functions ¶
func AsHealthProvider ¶
Types ¶
type Check ¶
type Check struct { // Overall status of the application. // It can be one of the following values: "pass", "warn", or "fail". Status Status // A map of check names to their respective details. Checks Checks }
Health status of the application.
type CheckDetail ¶
type CheckDetail struct { // A human-readable description of the check. Description string // Unit of measurement for the observed value. ObservedUnit string // Observed value of the check. ObservedValue int // Status of the check. // It can be one of the following values: "pass", "warn", or "fail". Status Status }
Details of a health check.
type DBProvider ¶
type DBProvider struct {
// contains filtered or unexported fields
}
func NewDBProvider ¶
func NewDBProvider(params DBProviderParams) *DBProvider
func (*DBProvider) HealthCheck ¶
func (p *DBProvider) HealthCheck(ctx context.Context) (Checks, error)
func (*DBProvider) Name ¶
func (p *DBProvider) Name() string
type HealthProvider ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(params ServiceParams) *Service
type ServiceParams ¶
type ServiceParams struct { fx.In HealthProviders []HealthProvider `group:"health-providers"` Logger *zap.Logger }
Click to show internal directories.
Click to hide internal directories.