Documentation ¶
Index ¶
- func MakeHealthCheckerLoggingMW(logger log.Logger) func(HealthChecker) HealthChecker
- func MakeValidationMiddleware(validValues map[string]struct{}) func(HealthChecker) HealthChecker
- type CockroachClient
- type CockroachModule
- type ErrInvalidHCName
- type FlakiClient
- type FlakiModule
- type HTTPClient
- type HealthChecker
- type InfluxClient
- type InfluxModule
- type JaegerModule
- type RedisClient
- type RedisModule
- type SentryClient
- type SentryModule
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeHealthCheckerLoggingMW ¶
func MakeHealthCheckerLoggingMW(logger log.Logger) func(HealthChecker) HealthChecker
MakeHealthCheckerLoggingMW makes a logging middleware for the health check modules.
func MakeValidationMiddleware ¶
func MakeValidationMiddleware(validValues map[string]struct{}) func(HealthChecker) HealthChecker
MakeValidationMiddleware makes a middleware that validate the health check name comming from the HTTP route. Let's imagine we have a module with the healthchecks "ping", "create", and "delete". In the validValues map, we list the health check authorized, with "" that is a special value for executing all healthchecks.
var validValues = map[string]struct{}{ "": struct{}{}, "ping": struct{}{}, "create": struct{}{}, "delete": struct{}{}, }
Types ¶
type CockroachClient ¶
type CockroachClient interface {
Ping() error
}
CockroachClient is the interface of the cockroach client.
type CockroachModule ¶
type CockroachModule struct {
// contains filtered or unexported fields
}
CockroachModule is the health check module for cockroach.
func NewCockroachModule ¶
func NewCockroachModule(cockroach CockroachClient, enabled bool) *CockroachModule
NewCockroachModule returns the cockroach health module.
func (*CockroachModule) HealthCheck ¶
func (m *CockroachModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired cockroach health check.
type ErrInvalidHCName ¶
type ErrInvalidHCName struct {
// contains filtered or unexported fields
}
ErrInvalidHCName is the error returned when there is a health request for an unknown healthcheck name.
func (*ErrInvalidHCName) Error ¶
func (e *ErrInvalidHCName) Error() string
type FlakiClient ¶
FlakiClient is the interface of the Flaki client.
type FlakiModule ¶
type FlakiModule struct {
// contains filtered or unexported fields
}
FlakiModule is the health check module for Flaki.
func NewFlakiModule ¶
func NewFlakiModule(client FlakiClient, enabled bool) *FlakiModule
NewFlakiModule returns the Flaki health module.
func (*FlakiModule) HealthCheck ¶
func (m *FlakiModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired influx health check.
type HTTPClient ¶
HTTPClient is the interface of the http client used to get health check status.
type HealthChecker ¶
HealthChecker is the interface of the health check modules.
type InfluxClient ¶
InfluxClient is the interface of the influx client.
type InfluxModule ¶
type InfluxModule struct {
// contains filtered or unexported fields
}
InfluxModule is the health check module for influx.
func NewInfluxModule ¶
func NewInfluxModule(influx InfluxClient, enabled bool) *InfluxModule
NewInfluxModule returns the influx health module.
func (*InfluxModule) HealthCheck ¶
func (m *InfluxModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired influx health check.
type JaegerModule ¶
type JaegerModule struct {
// contains filtered or unexported fields
}
JaegerModule is the health check module for jaeger.
func NewJaegerModule ¶
func NewJaegerModule(httpClient HTTPClient, collectorHealthHostPort string, enabled bool) *JaegerModule
NewJaegerModule returns the jaeger health module.
func (*JaegerModule) HealthCheck ¶
func (m *JaegerModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired jaeger health check.
type RedisClient ¶
RedisClient is the interface of the redis client.
type RedisModule ¶
type RedisModule struct {
// contains filtered or unexported fields
}
RedisModule is the health check module for redis.
func NewRedisModule ¶
func NewRedisModule(redis RedisClient, enabled bool) *RedisModule
NewRedisModule returns the redis health module.
func (*RedisModule) HealthCheck ¶
func (m *RedisModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired influx health check.
type SentryClient ¶
type SentryClient interface {
URL() string
}
SentryClient is the interface of the sentry client.
type SentryModule ¶
type SentryModule struct {
// contains filtered or unexported fields
}
SentryModule is the health check module for sentry.
func NewSentryModule ¶
func NewSentryModule(sentry SentryClient, httpClient HTTPClient, enabled bool) *SentryModule
NewSentryModule returns the sentry health module.
func (*SentryModule) HealthCheck ¶
func (m *SentryModule) HealthCheck(_ context.Context, name string) (json.RawMessage, error)
HealthCheck executes the desired influx health check.