18 lines
301 B
Go
18 lines
301 B
Go
package util
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type HealthChecker interface {
|
|
HealthCheck(ctx context.Context) error
|
|
}
|
|
|
|
type HealthCheckerFunc func(ctx context.Context) error
|
|
|
|
var _ HealthChecker = (*HealthCheckerFunc)(nil)
|
|
|
|
func (f HealthCheckerFunc) HealthCheck(ctx context.Context) error {
|
|
return f(ctx)
|
|
}
|