23 lines
392 B
Go
23 lines
392 B
Go
package health
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type GetClickhouseConsumerFunc func() (ClickhouseConnCheckInterface, error)
|
|
|
|
func NewClickhouseCheck(fn GetClickhouseConsumerFunc) CheckFunc {
|
|
return func(ctx context.Context) error {
|
|
conn, err := fn()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return conn.Ping(ctx)
|
|
}
|
|
}
|
|
|
|
type ClickhouseConnCheckInterface interface {
|
|
Ping(ctx context.Context) error
|
|
}
|